Update to Chromium revision cb947c01 (#352221)

- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle
  instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest
  object passed to OnBeforeBrowse will no longer have an associated request
  identifier.
- Mac: Remove additional helper apps which are no longer required (see
  http://crbug.com/520680)
- Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see
  http://crbug.com/517114)
- Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and
  NPAPI plugins are no longer supported (see http://crbug.com/470301#c11)
- Add CefFormatUrlForSecurityDisplay function in cef_parser.h
- Fix crash when passing `--disable-extensions` command-line flag (issue #1721)
- Linux: Fix NSS handler loading (issue #1727)
This commit is contained in:
Marshall Greenblatt
2015-10-09 11:23:12 -04:00
parent 5780ea8baa
commit 8aac23386e
104 changed files with 938 additions and 940 deletions

View File

@@ -206,9 +206,6 @@ if(OS_MACOSX)
# Fix the framework link in the main executable.
FIX_MACOSX_MAIN_FRAMEWORK_LINK(${CEF_TARGET} ${CEF_APP})
# Make the other helper app bundles.
MAKE_MACOSX_HELPERS(${CEF_TARGET} ${CEF_APP})
if(NOT ${CMAKE_GENERATOR} STREQUAL "Xcode")
# Manually process and copy over resource files.
# The Xcode generator handles this via the set_target_properties RESOURCE directive.

View File

@@ -336,7 +336,7 @@ bool ClientDialogHandlerGtk::OnJSDialog(
if (!origin_url.empty()) {
title += " - ";
title += origin_url.ToString();
title += CefFormatUrlForSecurityDisplay(origin_url, accept_lang).ToString();
}
GtkWidget* window = GetWindow(browser);

View File

@@ -26,7 +26,7 @@
<li><a href="client://tests/handler.html">Scheme Handler</a></li>
<li><a href="https://www.google.com/intl/en/chrome/demos/speech.html">Speech Input</a> - requires "enable-speech-input" flag</li>
<li><a href="http://tests/transparency">Transparency</a></li>
<li><a href="http://webglsamples.googlecode.com/hg/field/field.html">WebGL</a></li>
<li><a href="http://webglsamples.org/field/field.html">WebGL</a></li>
<li><a href="http://apprtc.appspot.com/">WebRTC</a> - requires "enable-media-stream" flag</li>
<li><a href="http://tests/urlrequest">CefURLRequest</a></li>
<li><a href="http://tests/xmlhttprequest">XMLHttpRequest</a></li>

View File

@@ -127,9 +127,6 @@ if(OS_MACOSX)
# Fix the framework link in the main executable.
FIX_MACOSX_MAIN_FRAMEWORK_LINK(${CEF_TARGET} ${CEF_APP})
# Make the other helper app bundles.
MAKE_MACOSX_HELPERS(${CEF_TARGET} ${CEF_APP})
if(NOT ${CMAKE_GENERATOR} STREQUAL "Xcode")
# Manually process and copy over resource files.
# The Xcode generator handles this via the set_target_properties RESOURCE directive.

View File

@@ -175,11 +175,24 @@ class FrameNavExpectationsBrowser : public FrameNavExpectations {
virtual std::string GetContentForURL(const std::string& url) =0;
// Browser-only notifications.
virtual bool OnAfterCreated(CefRefPtr<CefBrowser> browser) { return true; }
virtual bool OnAfterCreated(CefRefPtr<CefBrowser> browser) {
EXPECT_TRUE(browser.get());
return true;
}
virtual bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) { return true; }
CefRefPtr<CefFrame> frame,
const std::string& url) {
EXPECT_TRUE(browser.get());
EXPECT_TRUE(frame.get());
EXPECT_FALSE(url.empty());
return true;
}
virtual bool GetResourceHandler(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) { return true; }
CefRefPtr<CefFrame> frame) {
EXPECT_TRUE(browser.get());
EXPECT_TRUE(frame.get());
return true;
}
// Called when the renderer signals completion.
virtual bool OnRendererComplete(CefRefPtr<CefBrowser> browser,
@@ -495,8 +508,9 @@ class FrameNavTestHandler : public TestHandler {
CefRefPtr<CefFrame> frame,
CefRefPtr<CefRequest> request,
bool is_redirect) override {
EXPECT_TRUE(expectations_->OnBeforeBrowse(browser, frame)) <<
"nav = " << nav_;
EXPECT_TRUE(
expectations_->OnBeforeBrowse(browser, frame, request->GetURL())) <<
"nav = " << nav_;
return false;
}
@@ -618,7 +632,8 @@ class FrameNavExpectationsBrowserSingleNav :
}
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) override {
CefRefPtr<CefFrame> frame,
const std::string& url) override {
EXPECT_FALSE(got_before_browse_);
got_before_browse_.yes();
return true;
@@ -1019,11 +1034,12 @@ class FrameNavExpectationsBrowserTestSingleNav :
}
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) override {
CefRefPtr<CefFrame> frame,
const std::string& url) override {
V_DECLARE();
V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true,
std::string()));
V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame));
V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame, url));
V_RETURN();
}
@@ -1555,14 +1571,15 @@ class FrameNavExpectationsBrowserTestMultiNav :
}
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame) override {
CefRefPtr<CefFrame> frame,
const std::string& url) override {
V_DECLARE();
std::string expected_url;
if (nav() > 0)
expected_url = GetPreviousMainURL();
V_EXPECT_TRUE(VerifySingleBrowserFrames(browser, frame, true,
expected_url));
V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame));
V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame, url));
V_RETURN();
}
@@ -1893,6 +1910,23 @@ class FrameNavExpectationsBrowserTestNestedIframes :
got_load_end_[0] && got_load_end_[1] && got_load_end_[2];
}
bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser,
CefRefPtr<CefFrame> frame,
const std::string& url) override {
V_DECLARE();
V_EXPECT_TRUE(frame.get());
const int frame_number = GetNavFromMultiNavURL(url);
if (frame_number == 0) {
// Main frame.
V_EXPECT_TRUE(frame->IsMain());
} else {
// Sub frame.
V_EXPECT_FALSE(frame->IsMain());
}
V_EXPECT_TRUE(parent::OnBeforeBrowse(browser, frame, url));
V_RETURN();
}
bool OnLoadingStateChange(CefRefPtr<CefBrowser> browser,
bool isLoading) override {
V_DECLARE();

View File

@@ -102,7 +102,7 @@ class JSDialogTestHandler : public TestHandler {
bool& suppress_message) override {
got_onjsdialog_.yes();
EXPECT_STREQ("http://tests/", origin_url.ToString().c_str());
EXPECT_STREQ(kStartUrl, origin_url.ToString().c_str());
EXPECT_TRUE(accept_lang.empty());
if (type_ == TYPE_ALERT) {

View File

@@ -85,7 +85,7 @@ const int kVerticalScrollbarWidth = GetSystemMetrics(SM_CXVSCROLL);
const CefRect kEditBoxRect(442, 251, 46, 16);
const CefRect kNavigateButtonRect(375, 275, 130, 20);
const CefRect kSelectRect(461, 21, 87, 26);
const CefRect kExpandedSelectRect(466, 42, 79, 286);
const CefRect kExpandedSelectRect(466, 42, 76, 286);
const CefRect kDropDivRect(9, 330, 52, 52);
const CefRect kDragDivRect(60, 330, 52, 52);
const int kVerticalScrollbarWidth = 15;

View File

@@ -219,6 +219,34 @@ TEST(ParserTest, ParseURLNonStandard) {
EXPECT_STREQ("foo", query.ToString().c_str());
}
TEST(ParserTest, FormatUrlForSecurityDisplay) {
CefString result;
const char* kLang = "en-US";
// Omits the protocol if it's standard.
result = CefFormatUrlForSecurityDisplay("http://tests.com/foo.html", kLang);
EXPECT_STREQ("http://tests.com", result.ToString().c_str());
// Omits the port if it's the expected value for the protocol.
result = CefFormatUrlForSecurityDisplay("http://tests.com:80/foo.html",
kLang);
EXPECT_STREQ("http://tests.com", result.ToString().c_str());
// Don't omit non-standard ports.
result = CefFormatUrlForSecurityDisplay("http://tests.com:8088/foo.html",
kLang);
EXPECT_STREQ("http://tests.com:8088", result.ToString().c_str());
// Don't omit the protocol for file URLs.
result = CefFormatUrlForSecurityDisplay("file:///c/tests/foo.html", kLang);
EXPECT_STREQ("file:///c/tests/foo.html", result.ToString().c_str());
// Empty |languages| should be OK.
result = CefFormatUrlForSecurityDisplay("http://tests.com/foo.html",
CefString());
EXPECT_STREQ("http://tests.com", result.ToString().c_str());
}
TEST(ParserTest, GetMimeType) {
CefString mime_type;

View File

@@ -51,11 +51,7 @@ const char kPdfHtmlUrl[] = "http://tests/pdf.html";
const char kPdfDirectUrl[] = "http://tests/pdf.pdf";
// Delay waiting for iframe tests to load the PDF file.
#if defined(OS_WIN) || defined(OS_MACOSX)
const int64 kPdfLoadDelayMs = 2000;
#else
const int64 kPdfLoadDelayMs = 5000;
#endif
// Browser-side test handler.
class PluginTestHandler : public RoutingTestHandler,

View File

@@ -557,10 +557,8 @@ class ResourceResponseTest : public TestHandler {
// This method is only called for the main resource.
EXPECT_STREQ(kResourceTestHtml, request->GetURL().ToString().c_str());
// All loads of the main resource should keep the same request id.
EXPECT_EQ(0U, main_request_id_);
main_request_id_ = request->GetIdentifier();
EXPECT_GT(main_request_id_, 0U);
// Browser-side navigation no longer exposes the actual request information.
EXPECT_EQ(0U, request->GetIdentifier());
return false;
}
@@ -574,7 +572,10 @@ class ResourceResponseTest : public TestHandler {
EXPECT_EQ(browser_id_, browser->GetIdentifier());
if (request->GetURL() == kResourceTestHtml) {
EXPECT_EQ(main_request_id_, request->GetIdentifier());
// All loads of the main resource should keep the same request id.
EXPECT_EQ(0U, main_request_id_);
main_request_id_ = request->GetIdentifier();
EXPECT_GT(main_request_id_, 0U);
return RV_CONTINUE;
}