tests: Change HTTP test URLs to HTTPS
This avoids unexpected HTTP to HTTPS redirects which cause test failures with the Chrome runtime.
This commit is contained in:
parent
ab94a13522
commit
de4f9e8908
|
@ -1106,7 +1106,8 @@ void InterceptedRequest::OnURLLoaderClientError() {
|
|||
|
||||
void InterceptedRequest::OnURLLoaderError(uint32_t custom_reason,
|
||||
const std::string& description) {
|
||||
if (custom_reason == network::mojom::URLLoader::kClientDisconnectReason) {
|
||||
if (custom_reason == network::mojom::URLLoader::kClientDisconnectReason &&
|
||||
description == safe_browsing::kCustomCancelReasonForURLLoader) {
|
||||
SendErrorCallback(safe_browsing::kNetErrorCodeForSafeBrowsing, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
using client::ClientAppBrowser;
|
||||
|
||||
// Taken from:
|
||||
// http://www.iandevlin.com/blog/2012/09/html5/html5-media-and-data-uri/
|
||||
// https://www.iandevlin.com/blog/2012/09/html5/html5-media-and-data-uri/
|
||||
#define AUDIO_DATA \
|
||||
"data:audio/" \
|
||||
"ogg;base64,T2dnUwACAAAAAAAAAAA+" \
|
||||
|
@ -801,10 +801,10 @@ const int kSampleRate = 44100;
|
|||
const int kFramesPerBuffer = 882; // 10ms
|
||||
const CefAudioHandler::ChannelLayout kChannelLayout = CEF_CHANNEL_LAYOUT_STEREO;
|
||||
|
||||
const char kAudioOutputTestUrl[] = "http://tests/audiooutputtest";
|
||||
const char kAudioCloseBrowserTestUrl[] = "http://tests/audioclosebrowsertest";
|
||||
const char kAudioOutputTestUrl[] = "https://tests/audiooutputtest";
|
||||
const char kAudioCloseBrowserTestUrl[] = "https://tests/audioclosebrowsertest";
|
||||
const char kAudioTogglePlaybackTestUrl[] =
|
||||
"http://tests/audiotoggleplaybacktest";
|
||||
"https://tests/audiotoggleplaybacktest";
|
||||
|
||||
const char kTestHtml[] =
|
||||
"<!DOCTYPE html><html><head><meta "
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char* kTestUrl = "http://www.test.com/path/to/cookietest/foo.html";
|
||||
const char* kTestUrl = "https://www.test.com/path/to/cookietest/foo.html";
|
||||
const char* kTestDomain = "www.test.com";
|
||||
const char* kTestPath = "/path/to/cookietest";
|
||||
|
||||
|
@ -319,7 +319,7 @@ void TestInvalidCookie(CefRefPtr<CefCookieManager> manager,
|
|||
CookieVector cookies;
|
||||
|
||||
CefCookie cookie;
|
||||
const char* kUrl = "http://www.xyz.com";
|
||||
const char* kUrl = "https://www.xyz.com";
|
||||
CefString(&cookie.name).FromASCII("invalid1");
|
||||
CefString(&cookie.value).FromASCII("invalid1");
|
||||
CefString(&cookie.domain).FromASCII(".zyx.com"); // domain mismatch
|
||||
|
@ -441,7 +441,7 @@ void TestAllCookies(CefRefPtr<CefCookieManager> manager,
|
|||
|
||||
// Create cookies with 2 separate hosts.
|
||||
CefCookie cookie1;
|
||||
const char* kUrl1 = "http://www.foo.com";
|
||||
const char* kUrl1 = "https://www.foo.com";
|
||||
CefString(&cookie1.name).FromASCII("my_cookie1");
|
||||
CefString(&cookie1.value).FromASCII("My Value 1");
|
||||
|
||||
|
@ -450,7 +450,7 @@ void TestAllCookies(CefRefPtr<CefCookieManager> manager,
|
|||
cookies.clear();
|
||||
|
||||
CefCookie cookie2;
|
||||
const char* kUrl2 = "http://www.bar.com";
|
||||
const char* kUrl2 = "https://www.bar.com";
|
||||
CefString(&cookie2.name).FromASCII("my_cookie2");
|
||||
CefString(&cookie2.value).FromASCII("My Value 2");
|
||||
|
||||
|
@ -574,8 +574,8 @@ TEST(CookieTest, BasicAllCookies) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char* kCookieJSUrl1 = "http://tests/cookie1.html";
|
||||
const char* kCookieJSUrl2 = "http://tests/cookie2.html";
|
||||
const char* kCookieJSUrl1 = "https://tests/cookie1.html";
|
||||
const char* kCookieJSUrl2 = "https://tests/cookie2.html";
|
||||
|
||||
class CookieTestJSHandler : public TestHandler {
|
||||
public:
|
||||
|
@ -1023,7 +1023,7 @@ class CookieTestSchemeHandler : public TestHandler {
|
|||
// Verify use of the global cookie manager with HTTP.
|
||||
TEST(CookieTest, GetCookieManagerHttpGlobal) {
|
||||
CefRefPtr<CookieTestSchemeHandler> handler =
|
||||
new CookieTestSchemeHandler("http", true);
|
||||
new CookieTestSchemeHandler("https", true);
|
||||
handler->ExecuteTest();
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
@ -1031,7 +1031,7 @@ TEST(CookieTest, GetCookieManagerHttpGlobal) {
|
|||
// Verify use of an in-memory cookie manager with HTTP.
|
||||
TEST(CookieTest, GetCookieManagerHttpInMemory) {
|
||||
CefRefPtr<CookieTestSchemeHandler> handler =
|
||||
new CookieTestSchemeHandler("http", false);
|
||||
new CookieTestSchemeHandler("https", false);
|
||||
handler->ExecuteTest();
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
@ -1039,7 +1039,7 @@ TEST(CookieTest, GetCookieManagerHttpInMemory) {
|
|||
// Verify use of an in-memory cookie manager with HTTP to block all cookies.
|
||||
TEST(CookieTest, GetCookieManagerHttpInMemoryBlocked) {
|
||||
CefRefPtr<CookieTestSchemeHandler> handler =
|
||||
new CookieTestSchemeHandler("http", false, true);
|
||||
new CookieTestSchemeHandler("https", false, true);
|
||||
handler->ExecuteTest();
|
||||
ReleaseAndWaitForDestructor(handler);
|
||||
}
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTestUrl1[] = "http://tests/DevToolsMessage1";
|
||||
const char kTestUrl2[] = "http://tests/DevToolsMessage2";
|
||||
const char kTestUrl1[] = "https://tests/DevToolsMessage1";
|
||||
const char kTestUrl2[] = "https://tests/DevToolsMessage2";
|
||||
|
||||
class DevToolsMessageTestHandler : public TestHandler {
|
||||
public:
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char* kTestUrl = "http://tests/DialogTestHandler";
|
||||
const char* kTestUrl = "https://tests/DialogTestHandler";
|
||||
|
||||
class DialogTestHandler : public TestHandler {
|
||||
public:
|
||||
|
|
|
@ -19,8 +19,8 @@ namespace {
|
|||
// 4. History forward to kTitleUrl2 (title should be kTitleStr2)
|
||||
// 5. Set title via JavaScript (title should be kTitleStr3)
|
||||
|
||||
const char kTitleUrl1[] = "http://tests-title/nav1.html";
|
||||
const char kTitleUrl2[] = "http://tests-title/nav2.html";
|
||||
const char kTitleUrl1[] = "https://tests-title/nav1.html";
|
||||
const char kTitleUrl2[] = "https://tests-title/nav2.html";
|
||||
const char kTitleStr1[] = "Title 1";
|
||||
const char kTitleStr2[] = "Title 2";
|
||||
const char kTitleStr3[] = "Title 3";
|
||||
|
@ -151,7 +151,7 @@ TEST(DisplayTest, Title) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kAutoResizeUrl[] = "http://tests-display/auto-resize.html";
|
||||
const char kAutoResizeUrl[] = "https://tests-display/auto-resize.html";
|
||||
|
||||
class AutoResizeTestHandler : public RoutingTestHandler {
|
||||
public:
|
||||
|
@ -260,7 +260,7 @@ class ConsoleTestHandler : public TestHandler {
|
|||
: level(message_level),
|
||||
message("'Test Message'"),
|
||||
expected_message("Test Message"),
|
||||
source("http://tests-console-message/level.html"),
|
||||
source("https://tests-console-message/level.html"),
|
||||
line(42) {}
|
||||
|
||||
cef_log_severity_t level;
|
||||
|
@ -464,7 +464,7 @@ TEST(DisplayTest, OnConsoleMessageAssert) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kLoadinProgressUrl[] = "http://tests-display/loading-progress.html";
|
||||
const char kLoadinProgressUrl[] = "https://tests-display/loading-progress.html";
|
||||
|
||||
// Browser side.
|
||||
class LoadingProgressTestHandler : public TestHandler {
|
||||
|
|
|
@ -11,7 +11,7 @@ using client::ClientAppRenderer;
|
|||
|
||||
namespace {
|
||||
|
||||
const char* kTestUrl = "http://tests/DOMTest.Test";
|
||||
const char* kTestUrl = "https://tests/DOMTest.Test";
|
||||
const char* kTestMessage = "DOMTest.Message";
|
||||
|
||||
enum DOMTestType {
|
||||
|
@ -149,7 +149,7 @@ class TestDOMVisitor : public CefDOMVisitor {
|
|||
void TestStructure(CefRefPtr<CefDOMDocument> document) {
|
||||
EXPECT_EQ(document->GetTitle(), "The Title");
|
||||
EXPECT_EQ(document->GetBaseURL(), kTestUrl);
|
||||
EXPECT_EQ(document->GetCompleteURL("foo.html"), "http://tests/foo.html");
|
||||
EXPECT_EQ(document->GetCompleteURL("foo.html"), "https://tests/foo.html");
|
||||
|
||||
// Navigate the complete document structure.
|
||||
CefRefPtr<CefDOMNode> docNode = document->GetDocument();
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
namespace {
|
||||
|
||||
const char kTestDomain[] = "test-download.com";
|
||||
const char kTestStartUrl[] = "http://test-download.com/test.html";
|
||||
const char kTestDownloadUrl[] = "http://test-download.com/download.txt";
|
||||
const char kTestNavUrl[] = "http://test-download-nav.com/nav.html";
|
||||
const char kTestStartUrl[] = "https://test-download.com/test.html";
|
||||
const char kTestDownloadUrl[] = "https://test-download.com/download.txt";
|
||||
const char kTestNavUrl[] = "https://test-download-nav.com/nav.html";
|
||||
const char kTestFileName[] = "download_test.txt";
|
||||
const char kTestContentDisposition[] =
|
||||
"attachment; filename=\"download_test.txt\"";
|
||||
|
@ -215,10 +215,10 @@ class DownloadTestHandler : public TestHandler {
|
|||
CefRefPtr<CefRequestContext> request_context =
|
||||
CreateTestRequestContext(rc_mode_, rc_cache_path_);
|
||||
if (request_context) {
|
||||
request_context->RegisterSchemeHandlerFactory("http", kTestDomain,
|
||||
request_context->RegisterSchemeHandlerFactory("https", kTestDomain,
|
||||
scheme_factory);
|
||||
} else {
|
||||
CefRegisterSchemeHandlerFactory("http", kTestDomain, scheme_factory);
|
||||
CefRegisterSchemeHandlerFactory("https", kTestDomain, scheme_factory);
|
||||
}
|
||||
|
||||
if (!is_clicked() || is_clicked_and_downloaded()) {
|
||||
|
@ -486,11 +486,11 @@ class DownloadTestHandler : public TestHandler {
|
|||
}
|
||||
|
||||
if (request_context_) {
|
||||
request_context_->RegisterSchemeHandlerFactory("http", kTestDomain,
|
||||
request_context_->RegisterSchemeHandlerFactory("https", kTestDomain,
|
||||
nullptr);
|
||||
request_context_ = nullptr;
|
||||
} else {
|
||||
CefRegisterSchemeHandlerFactory("http", kTestDomain, nullptr);
|
||||
CefRegisterSchemeHandlerFactory("https", kTestDomain, nullptr);
|
||||
}
|
||||
|
||||
if (is_clicked()) {
|
||||
|
|
|
@ -223,16 +223,16 @@ class DraggableRegionsTestHandler : public TestHandler,
|
|||
// When |same_origin_| is true every other URL gets a different origin.
|
||||
switch (step) {
|
||||
case kStepWithRegions:
|
||||
return same_origin_ ? "http://test.com/regions"
|
||||
: "http://test2.com/regions";
|
||||
return same_origin_ ? "https://test.com/regions"
|
||||
: "https://test2.com/regions";
|
||||
case kStepWithChangingRegions:
|
||||
case kStepWithChangingRegions2:
|
||||
case kStepWithChangingRegions3:
|
||||
return "http://test.com/changing-regions";
|
||||
return "https://test.com/changing-regions";
|
||||
case kStepWithoutRegions:
|
||||
case kStepWithoutRegions2:
|
||||
return same_origin_ ? "http://test.com/no-regions"
|
||||
: "http://test2.com/no-regions";
|
||||
return same_origin_ ? "https://test.com/no-regions"
|
||||
: "https://test2.com/no-regions";
|
||||
}
|
||||
|
||||
NOTREACHED();
|
||||
|
|
|
@ -506,7 +506,7 @@ struct FrameStatus {
|
|||
int delivered_query_ct_ = 0;
|
||||
};
|
||||
|
||||
const char kOrderMainUrl[] = "http://tests-frame-handler/main-order.html";
|
||||
const char kOrderMainUrl[] = "https://tests-frame-handler/main-order.html";
|
||||
|
||||
class OrderMainTestHandler : public RoutingTestHandler, public CefFrameHandler {
|
||||
public:
|
||||
|
@ -797,7 +797,7 @@ TEST(FrameHandlerTest, OrderMain) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kOrderMainUrlPrefix[] = "http://tests-frame-handler";
|
||||
const char kOrderMainUrlPrefix[] = "https://tests-frame-handler";
|
||||
|
||||
class NavigateOrderMainTestHandler : public OrderMainTestHandler {
|
||||
public:
|
||||
|
@ -1468,7 +1468,7 @@ TEST(FrameHandlerTest, OrderSubCrossOriginChildrenNavCrossOrigin) {
|
|||
namespace {
|
||||
|
||||
const char kOrderMainCrossUrl[] =
|
||||
"http://tests-frame-handler-cross/main-order.html";
|
||||
"https://tests-frame-handler-cross/main-order.html";
|
||||
|
||||
// Will be assigned as popup handler via
|
||||
// ParentOrderMainTestHandler::OnBeforePopup.
|
||||
|
|
|
@ -93,10 +93,10 @@ const char kFrameNavMsg[] = "FrameTest.Navigation";
|
|||
const char kFrameNavTestCmdKey[] = "frame-nav-test";
|
||||
|
||||
// Origins used in tests.
|
||||
const char kFrameNavOrigin0[] = "http://tests-framenav0.com/";
|
||||
const char kFrameNavOrigin1[] = "http://tests-framenav1.com/";
|
||||
const char kFrameNavOrigin2[] = "http://tests-framenav2.com/";
|
||||
const char kFrameNavOrigin3[] = "http://tests-framenav3.com/";
|
||||
const char kFrameNavOrigin0[] = "https://tests-framenav0.com/";
|
||||
const char kFrameNavOrigin1[] = "https://tests-framenav1.com/";
|
||||
const char kFrameNavOrigin2[] = "https://tests-framenav2.com/";
|
||||
const char kFrameNavOrigin3[] = "https://tests-framenav3.com/";
|
||||
|
||||
// Maximum number of navigations. Should be kept synchronized with the number
|
||||
// of kFrameNavOrigin* values. Don't modify this value without checking the
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char* kStartUrl = "http://tests/JSDialogTestHandler.Start";
|
||||
const char* kEndUrl = "http://tests/JSDialogTestHandler.End?r=";
|
||||
const char* kStartUrl = "https://tests/JSDialogTestHandler.Start";
|
||||
const char* kEndUrl = "https://tests/JSDialogTestHandler.End?r=";
|
||||
|
||||
class JSDialogTestHandler : public TestHandler {
|
||||
public:
|
||||
|
@ -152,7 +152,7 @@ class JSDialogTestHandler : public TestHandler {
|
|||
|
||||
if (type_ == TYPE_ONBEFOREUNLOAD) {
|
||||
// The message is no longer configurable via JavaScript.
|
||||
// See http://crbug.com/587940.
|
||||
// See https://crbug.com/587940.
|
||||
EXPECT_STREQ("Is it OK to leave/reload this page?",
|
||||
message_text.ToString().c_str());
|
||||
EXPECT_FALSE(is_reload);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char kLifeSpanUrl[] = "http://tests-life-span/test.html";
|
||||
const char kLifeSpanUrl[] = "https://tests-life-span/test.html";
|
||||
const char kUnloadDialogText[] = "Are you sure?";
|
||||
const char kUnloadMsg[] = "LifeSpanTestHandler.Unload";
|
||||
|
||||
|
@ -100,7 +100,7 @@ class LifeSpanTestHandler : public RoutingTestHandler {
|
|||
EXPECT_TRUE(browser->IsSame(GetBrowser()));
|
||||
|
||||
// The message is no longer configurable via JavaScript.
|
||||
// See http://crbug.com/587940.
|
||||
// See https://crbug.com/587940.
|
||||
EXPECT_STREQ("Is it OK to leave/reload this page?",
|
||||
message_text.ToString().c_str());
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ class MediaAccessTestHandler : public TestHandler, public CefPermissionHandler {
|
|||
" data = {};"
|
||||
" }"
|
||||
" document.location = "
|
||||
"`http://tests/"
|
||||
"`https://tests/"
|
||||
"exit?result=${val}&data=${encodeURIComponent(JSON.stringify(data))}`;"
|
||||
"}"
|
||||
"function runTest() {";
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTestDomain1[] = "http://tests-mr1.com/";
|
||||
const char kTestDomain2[] = "http://tests-mr2.com/";
|
||||
const char kTestDomain3[] = "http://tests-mr3.com/";
|
||||
const char kTestDomain1[] = "https://tests-mr1.com/";
|
||||
const char kTestDomain2[] = "https://tests-mr2.com/";
|
||||
const char kTestDomain3[] = "https://tests-mr3.com/";
|
||||
|
||||
const char kMultiQueryRequestId[] = "request_id";
|
||||
const char kMultiQueryRepeatCt[] = "repeat_ct";
|
||||
|
|
|
@ -9,7 +9,7 @@ extern const char kJSQueryCancelFunc[] = "mrtQueryCancel";
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTestDomainRoot[] = "http://tests-mr";
|
||||
const char kTestDomainRoot[] = "https://tests-mr";
|
||||
const char kDoneMessageName[] = "mrtNotifyMsg";
|
||||
const char kJSNotifyFunc[] = "mrtNotify";
|
||||
const char kJSAssertTotalCountFunc[] = "mrtAssertTotalCount";
|
||||
|
@ -239,7 +239,7 @@ void MRTestHandler::AssertMainBrowser(CefRefPtr<CefBrowser> browser) {
|
|||
}
|
||||
|
||||
SingleLoadTestHandler::SingleLoadTestHandler()
|
||||
: main_url_("http://tests-mr.com/main.html") {}
|
||||
: main_url_("https://tests-mr.com/main.html") {}
|
||||
|
||||
void SingleLoadTestHandler::RunMRTest() {
|
||||
AddOtherResources();
|
||||
|
|
|
@ -23,9 +23,9 @@ using client::ClientAppRenderer;
|
|||
|
||||
namespace {
|
||||
|
||||
const char kHNav1[] = "http://tests-hnav.com/nav1.html";
|
||||
const char kHNav2[] = "http://tests-hnav.com/nav2.html";
|
||||
const char kHNav3[] = "http://tests-hnav.com/nav3.html";
|
||||
const char kHNav1[] = "https://tests-hnav.com/nav1.html";
|
||||
const char kHNav2[] = "https://tests-hnav.com/nav2.html";
|
||||
const char kHNav3[] = "https://tests-hnav.com/nav3.html";
|
||||
const char kHistoryNavMsg[] = "NavigationTest.HistoryNav";
|
||||
const char kHistoryNavTestCmdKey[] = "nav-history-test";
|
||||
|
||||
|
@ -644,8 +644,8 @@ TEST(NavigationTest, History) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kDynIfrNav1[] = "http://tests-dynframe/nav1.html";
|
||||
const char kDynIfrNav2[] = "http://tests-dynframe/nav2.html";
|
||||
const char kDynIfrNav1[] = "https://tests-dynframe/nav1.html";
|
||||
const char kDynIfrNav2[] = "https://tests-dynframe/nav2.html";
|
||||
|
||||
// Browser side.
|
||||
class HistoryDynamicIFramesNavTestHandler : public TestHandler {
|
||||
|
@ -779,10 +779,10 @@ TEST(NavigationTest, HistoryDynamicIFrames) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kRNav1[] = "http://tests/nav1.html";
|
||||
const char kRNav2[] = "http://tests/nav2.html";
|
||||
const char kRNav3[] = "http://tests/nav3.html";
|
||||
const char kRNav4[] = "http://tests/nav4.html";
|
||||
const char kRNav1[] = "https://tests/nav1.html";
|
||||
const char kRNav2[] = "https://tests/nav2.html";
|
||||
const char kRNav3[] = "https://tests/nav3.html";
|
||||
const char kRNav4[] = "https://tests/nav4.html";
|
||||
|
||||
bool g_got_nav1_request = false;
|
||||
bool g_got_nav3_request = false;
|
||||
|
@ -1080,7 +1080,7 @@ class RedirectDestroyTestHandler : public TestHandler {
|
|||
|
||||
// Verify frame names and identifiers.
|
||||
TEST(NavigationTest, Redirect) {
|
||||
CefRegisterSchemeHandlerFactory("http", "tests",
|
||||
CefRegisterSchemeHandlerFactory("https", "tests",
|
||||
new RedirectSchemeHandlerFactory());
|
||||
WaitForIOThread();
|
||||
|
||||
|
@ -1113,7 +1113,7 @@ TEST(NavigationTest, Redirect) {
|
|||
// Verify that destroying the WebContents while the redirect is in-progress does
|
||||
// not result in a crash.
|
||||
TEST(NavigationTest, RedirectDestroy) {
|
||||
CefRegisterSchemeHandlerFactory("http", "tests",
|
||||
CefRegisterSchemeHandlerFactory("https", "tests",
|
||||
new RedirectSchemeHandlerFactory());
|
||||
WaitForIOThread();
|
||||
|
||||
|
@ -1135,8 +1135,8 @@ TEST(NavigationTest, RedirectDestroy) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char KONav1[] = "http://tests-onav.com/nav1.html";
|
||||
const char KONav2[] = "http://tests-onav.com/nav2.html";
|
||||
const char KONav1[] = "https://tests-onav.com/nav1.html";
|
||||
const char KONav2[] = "https://tests-onav.com/nav2.html";
|
||||
const char kOrderNavMsg[] = "NavigationTest.OrderNav";
|
||||
const char kOrderNavClosedMsg[] = "NavigationTest.OrderNavClosed";
|
||||
const char kOrderNavTestCmdKey[] = "nav-order-test";
|
||||
|
@ -1701,9 +1701,9 @@ TEST(NavigationTest, Order) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kLoadNav1[] = "http://tests-conav1.com/nav1.html";
|
||||
const char kLoadNavSameOrigin2[] = "http://tests-conav1.com/nav2.html";
|
||||
const char kLoadNavCrossOrigin2[] = "http://tests-conav2.com/nav2.html";
|
||||
const char kLoadNav1[] = "https://tests-conav1.com/nav1.html";
|
||||
const char kLoadNavSameOrigin2[] = "https://tests-conav1.com/nav2.html";
|
||||
const char kLoadNavCrossOrigin2[] = "https://tests-conav2.com/nav2.html";
|
||||
const char kLoadNavMsg[] = "NavigationTest.LoadNav";
|
||||
const char kLoadNavTestCmdKey[] = "nav-load-test";
|
||||
|
||||
|
@ -2244,8 +2244,8 @@ TEST(NavigationTest, LoadCrossOriginCtrlLeftClickCancel) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kSimultPopupMainUrl[] = "http://www.tests-sp.com/main.html";
|
||||
const char kSimultPopupPopupUrl[] = "http://www.tests-sp.com/popup";
|
||||
const char kSimultPopupMainUrl[] = "https://www.tests-sp.com/main.html";
|
||||
const char kSimultPopupPopupUrl[] = "https://www.tests-sp.com/popup";
|
||||
const size_t kSimultPopupCount = 5U;
|
||||
|
||||
// Test multiple popups simultaniously.
|
||||
|
@ -2404,8 +2404,8 @@ TEST(NavigationTest, PopupSimultaneousSameUrl) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kPopupJSOpenMainUrl[] = "http://www.tests-pjso.com/main.html";
|
||||
const char kPopupJSOpenPopupUrl[] = "http://www.tests-pjso.com/popup.html";
|
||||
const char kPopupJSOpenMainUrl[] = "https://www.tests-pjso.com/main.html";
|
||||
const char kPopupJSOpenPopupUrl[] = "https://www.tests-pjso.com/popup.html";
|
||||
|
||||
// Test a popup where the URL is a JavaScript URI that opens another popup.
|
||||
class PopupJSWindowOpenTestHandler : public TestHandler {
|
||||
|
@ -2551,7 +2551,7 @@ TEST(NavigationTest, PopupJSWindowOpen) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kPopupJSEmptyMainUrl[] = "http://www.tests-pjse.com/main.html";
|
||||
const char kPopupJSEmptyMainUrl[] = "https://www.tests-pjse.com/main.html";
|
||||
|
||||
// Test creation of a popup where the URL is empty.
|
||||
class PopupJSWindowEmptyTestHandler : public TestHandler {
|
||||
|
@ -2656,7 +2656,7 @@ TEST(NavigationTest, PopupJSWindowEmpty) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kBrowseNavPageUrl[] = "http://tests-browsenav/nav.html";
|
||||
const char kBrowseNavPageUrl[] = "https://tests-browsenav/nav.html";
|
||||
|
||||
// Browser side.
|
||||
class BrowseNavTestHandler : public TestHandler {
|
||||
|
@ -2822,7 +2822,7 @@ TEST(NavigationTest, BrowseDeny) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kSameNavPageUrl[] = "http://tests-samenav/nav.html";
|
||||
const char kSameNavPageUrl[] = "https://tests-samenav/nav.html";
|
||||
|
||||
// Browser side.
|
||||
class SameNavTestHandler : public TestHandler {
|
||||
|
@ -2982,7 +2982,7 @@ TEST(NavigationTest, SamePage) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kCancelPageUrl[] = "http://tests-cancelnav/nav.html";
|
||||
const char kCancelPageUrl[] = "https://tests-cancelnav/nav.html";
|
||||
|
||||
// A scheme handler that never starts sending data.
|
||||
class UnstartedSchemeHandler : public CefResourceHandler {
|
||||
|
@ -3495,9 +3495,9 @@ TEST(NavigationTest, CancelAfterCommit) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kExtraInfoUrl[] = "http://tests-extrainfonav.com/extra.html";
|
||||
const char kExtraInfoUrl[] = "https://tests-extrainfonav.com/extra.html";
|
||||
const char kExtraInfoPopupUrl[] =
|
||||
"http://tests-extrainfonav.com/extra_popup.html";
|
||||
"https://tests-extrainfonav.com/extra_popup.html";
|
||||
const char kExtraInfoNavMsg[] = "NavigationTest.ExtraInfoNav";
|
||||
const char kExtraInfoTestCmdKey[] = "nav-extra-info-test";
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ HINSTANCE hInst = ::GetModuleHandle(nullptr);
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTestUrl[] = "http://tests/osrtest";
|
||||
const char kTestUrl[] = "https://tests/osrtest";
|
||||
|
||||
// Must be both large enough for the drag/drop region to be visible and small
|
||||
// enough for a little vertical offset with scrollbar.
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char kPdfHtmlUrl[] = "http://tests/pdf.html";
|
||||
const char kPdfDirectUrl[] = "http://tests/pdf.pdf";
|
||||
const char kPdfHtmlUrl[] = "https://tests/pdf.html";
|
||||
const char kPdfDirectUrl[] = "https://tests/pdf.pdf";
|
||||
|
||||
// Delay waiting for iframe tests to load the PDF file.
|
||||
#if defined(OS_LINUX)
|
||||
|
|
|
@ -113,7 +113,7 @@ class PermissionPromptTestHandler : public TestHandler,
|
|||
" data = {};"
|
||||
" }"
|
||||
" document.location = "
|
||||
"`http://tests/"
|
||||
"`https://tests/"
|
||||
"exit?result=${val}&data=${encodeURIComponent(JSON.stringify(data))}`;"
|
||||
"}"
|
||||
"function makeRequest() {";
|
||||
|
|
|
@ -16,7 +16,7 @@ using client::ClientAppRenderer;
|
|||
namespace {
|
||||
|
||||
// Unique values for the SendRecv test.
|
||||
const char kSendRecvUrl[] = "http://tests/ProcessMessageTest.SendRecv";
|
||||
const char kSendRecvUrl[] = "https://tests/ProcessMessageTest.SendRecv";
|
||||
const char kSendRecvMsg[] = "ProcessMessageTest.SendRecv";
|
||||
|
||||
// Creates a test message.
|
||||
|
|
|
@ -206,11 +206,11 @@ class PopupTestHandler : public TestHandler {
|
|||
};
|
||||
|
||||
PopupTestHandler(bool same_origin, Mode mode) : mode_(mode) {
|
||||
url_ = "http://tests-simple-rch1.com/nav1.html";
|
||||
url_ = "https://tests-simple-rch1.com/nav1.html";
|
||||
if (same_origin) {
|
||||
popup_url_ = "http://tests-simple-rch1.com/pop1.html";
|
||||
popup_url_ = "https://tests-simple-rch1.com/pop1.html";
|
||||
} else {
|
||||
popup_url_ = "http://tests-simple-rch2.com/pop1.html";
|
||||
popup_url_ = "https://tests-simple-rch2.com/pop1.html";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -446,9 +446,9 @@ TEST(RequestContextTest, PopupBasicNoReferrerLinkDifferentOrigin) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kPopupNavPageUrl[] = "http://tests-popup.com/page.html";
|
||||
const char kPopupNavPopupUrl[] = "http://tests-popup.com/popup.html";
|
||||
const char kPopupNavPopupUrl2[] = "http://tests-popup2.com/popup.html";
|
||||
const char kPopupNavPageUrl[] = "https://tests-popup.com/page.html";
|
||||
const char kPopupNavPopupUrl[] = "https://tests-popup.com/popup.html";
|
||||
const char kPopupNavPopupUrl2[] = "https://tests-popup2.com/popup.html";
|
||||
const char kPopupNavPopupName[] = "my_popup";
|
||||
|
||||
// Browser side.
|
||||
|
@ -757,7 +757,7 @@ POPUP_TEST_GROUP(DestroyParentAfterCreationForce,
|
|||
|
||||
namespace {
|
||||
|
||||
const char kResolveOrigin[] = "http://www.google.com";
|
||||
const char kResolveOrigin[] = "https://www.google.com";
|
||||
|
||||
class MethodTestHandler : public TestHandler {
|
||||
public:
|
||||
|
@ -808,7 +808,7 @@ class MethodTestHandler : public TestHandler {
|
|||
: global_context_(global_context), method_(method) {}
|
||||
|
||||
void RunTest() override {
|
||||
const char kUrl[] = "http://tests/method.html";
|
||||
const char kUrl[] = "https://tests/method.html";
|
||||
|
||||
AddResource(kUrl, "<html><body>Method</body></html>", "text/html");
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ enum NetNotifyTestType {
|
|||
NNTT_DELAYED_BROWSER,
|
||||
};
|
||||
|
||||
const char kNetNotifyOrigin1[] = "http://tests-netnotify1/";
|
||||
const char kNetNotifyOrigin2[] = "http://tests-netnotify2/";
|
||||
const char kNetNotifyOrigin1[] = "https://tests-netnotify1/";
|
||||
const char kNetNotifyOrigin2[] = "https://tests-netnotify2/";
|
||||
const char kNetNotifyMsg[] = "RequestHandlerTest.NetNotify";
|
||||
const char kNetNotifyTestCmdKey[] = "rh-net-notify-test";
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ TEST(RequestTest, SetGet) {
|
|||
EXPECT_TRUE(request.get() != nullptr);
|
||||
EXPECT_EQ(0U, request->GetIdentifier());
|
||||
|
||||
CefString url = "http://tests.com/run.html";
|
||||
CefString url = "https://tests.com/run.html";
|
||||
CefString method = "POST";
|
||||
CefRequest::HeaderMap setHeaders, getHeaders;
|
||||
setHeaders.insert(std::make_pair("HeaderA", "ValueA"));
|
||||
|
@ -88,10 +88,10 @@ TEST(RequestTest, SetGet) {
|
|||
EXPECT_EQ(method, request->GetMethod());
|
||||
|
||||
// CefRequest SetReferrer
|
||||
CefString referrer = "http://tests.com/referrer.html";
|
||||
CefString referrer = "https://tests.com/referrer.html";
|
||||
CefRequest::ReferrerPolicy policy = REFERRER_POLICY_ORIGIN;
|
||||
request->SetReferrer(referrer, policy);
|
||||
EXPECT_STREQ("http://tests.com/",
|
||||
EXPECT_STREQ("https://tests.com/",
|
||||
request->GetReferrerURL().ToString().c_str());
|
||||
EXPECT_EQ(policy, request->GetReferrerPolicy());
|
||||
|
||||
|
@ -188,7 +188,7 @@ TEST(RequestTest, SetGetHeaderByName) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTestUrl[] = "http://tests.com/run.html";
|
||||
const char kTestUrl[] = "https://tests.com/run.html";
|
||||
|
||||
void CreateRequest(CefRefPtr<CefRequest>& request) {
|
||||
request = CefRequest::Create();
|
||||
|
@ -197,7 +197,7 @@ void CreateRequest(CefRefPtr<CefRequest>& request) {
|
|||
request->SetURL(kTestUrl);
|
||||
request->SetMethod("POST");
|
||||
|
||||
request->SetReferrer("http://tests.com/main.html", REFERRER_POLICY_DEFAULT);
|
||||
request->SetReferrer("https://tests.com/main.html", REFERRER_POLICY_DEFAULT);
|
||||
|
||||
CefRequest::HeaderMap headers;
|
||||
headers.insert(std::make_pair("HeaderA", "ValueA"));
|
||||
|
@ -380,7 +380,7 @@ TEST(RequestTest, SendRecv) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTypeTestOrigin[] = "http://tests-requesttt.com/";
|
||||
const char kTypeTestOrigin[] = "https://tests-requesttt.com/";
|
||||
const cef_transition_type_t kTransitionExplicitLoad =
|
||||
static_cast<cef_transition_type_t>(TT_EXPLICIT | TT_DIRECT_LOAD_FLAG);
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@ class ResourceManagerTestHandler : public RoutingTestHandler {
|
|||
|
||||
// Test with no providers.
|
||||
TEST(ResourceManagerTest, NoProviders) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -286,7 +286,7 @@ class ProviderDestructHelper {
|
|||
// Test that that the URL retrieved via Request::url() is parsed as expected.
|
||||
// Fragment or query components in any order should be removed.
|
||||
void TestUrlParsing(const char* kUrl) {
|
||||
const char kRequestUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kRequestUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -326,23 +326,23 @@ void TestUrlParsing(const char* kUrl) {
|
|||
} // namespace
|
||||
|
||||
TEST(ResourceManagerTest, UrlParsingNoQueryOrFragment) {
|
||||
TestUrlParsing("http://test.com/ResourceManagerTest");
|
||||
TestUrlParsing("https://test.com/ResourceManagerTest");
|
||||
}
|
||||
|
||||
TEST(ResourceManagerTest, UrlParsingWithQuery) {
|
||||
TestUrlParsing("http://test.com/ResourceManagerTest?foo=bar&choo=too");
|
||||
TestUrlParsing("https://test.com/ResourceManagerTest?foo=bar&choo=too");
|
||||
}
|
||||
|
||||
TEST(ResourceManagerTest, UrlParsingWithFragment) {
|
||||
TestUrlParsing("http://test.com/ResourceManagerTest#some/fragment");
|
||||
TestUrlParsing("https://test.com/ResourceManagerTest#some/fragment");
|
||||
}
|
||||
|
||||
TEST(ResourceManagerTest, UrlParsingWithQueryAndFragment) {
|
||||
TestUrlParsing("http://test.com/ResourceManagerTest?foo=bar#some/fragment");
|
||||
TestUrlParsing("https://test.com/ResourceManagerTest?foo=bar#some/fragment");
|
||||
}
|
||||
|
||||
TEST(ResourceManagerTest, UrlParsingWithFragmentAndQuery) {
|
||||
TestUrlParsing("http://test.com/ResourceManagerTest#some/fragment?foo=bar");
|
||||
TestUrlParsing("https://test.com/ResourceManagerTest#some/fragment?foo=bar");
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -406,7 +406,7 @@ class SimpleTestProvider : public TestProvider {
|
|||
|
||||
// Test with multiple providers that do not handle the request.
|
||||
TEST(ResourceManagerTest, ProviderNotHandled) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -453,7 +453,7 @@ TEST(ResourceManagerTest, ProviderNotHandled) {
|
|||
|
||||
// Test with multiple providers that all continue.
|
||||
TEST(ResourceManagerTest, ProviderContinue) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -500,7 +500,7 @@ TEST(ResourceManagerTest, ProviderContinue) {
|
|||
|
||||
// Test with multiple providers where the first one stops.
|
||||
TEST(ResourceManagerTest, ProviderStop) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -549,7 +549,7 @@ TEST(ResourceManagerTest, ProviderStop) {
|
|||
// Test with multiple providers where the first one removes multiple providers
|
||||
// including itself.
|
||||
TEST(ResourceManagerTest, ProviderRemove) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -609,7 +609,7 @@ TEST(ResourceManagerTest, ProviderRemove) {
|
|||
|
||||
// Test with multiple providers where the first provider removes all.
|
||||
TEST(ResourceManagerTest, ProviderRemoveAll) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -668,7 +668,7 @@ TEST(ResourceManagerTest, ProviderRemoveAll) {
|
|||
// Test with multiple providers that do not continue and will be destroyed when
|
||||
// the manager is destroyed.
|
||||
TEST(ResourceManagerTest, ProviderDoNothing) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -723,9 +723,9 @@ TEST(ResourceManagerTest, ProviderDoNothing) {
|
|||
|
||||
// Test AddContentProvider.
|
||||
TEST(ResourceManagerTest, ContentProvider) {
|
||||
const char kUrl1[] = "http://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "http://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "http://test.com/ResourceManagerTest3";
|
||||
const char kUrl1[] = "https://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "https://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "https://test.com/ResourceManagerTest3";
|
||||
|
||||
const std::string& success1_message = CreateMessage(kDoneMsg, "Success1");
|
||||
const std::string& success2_message = CreateMessage(kDoneMsg, "Success2");
|
||||
|
@ -762,7 +762,7 @@ TEST(ResourceManagerTest, ContentProvider) {
|
|||
|
||||
// Test AddDirectoryProvider.
|
||||
TEST(ResourceManagerTest, DirectoryProvider) {
|
||||
const char kUrlBase[] = "http://test.com/ResourceManager";
|
||||
const char kUrlBase[] = "https://test.com/ResourceManager";
|
||||
const char kFile1[] = "File1.html";
|
||||
const char kFile2[] = "File2.html";
|
||||
const char kFile3[] = "File3.html";
|
||||
|
@ -820,7 +820,7 @@ TEST(ResourceManagerTest, DirectoryProvider) {
|
|||
|
||||
// Test AddArchiveProvider.
|
||||
TEST(ResourceManagerTest, ArchiveProvider) {
|
||||
const char kUrlBase[] = "http://test.com/ResourceManager";
|
||||
const char kUrlBase[] = "https://test.com/ResourceManager";
|
||||
const char kFile1[] = "File1.html";
|
||||
const char kFile2[] = "File2.html";
|
||||
const char kFile3[] = "File3.html";
|
||||
|
@ -936,11 +936,11 @@ class OneShotProvider : public CefResourceManager::Provider {
|
|||
// Test that providers are called in the expected order and return expected
|
||||
// results.
|
||||
TEST(ResourceManagerTest, ProviderOrder) {
|
||||
const char kUrl1[] = "http://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "http://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "http://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "http://test.com/ResourceManagerTest4";
|
||||
const char kUrl5[] = "http://test.com/ResourceManagerTest5";
|
||||
const char kUrl1[] = "https://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "https://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "https://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "https://test.com/ResourceManagerTest4";
|
||||
const char kUrl5[] = "https://test.com/ResourceManagerTest5";
|
||||
|
||||
const std::string& success1_message = CreateMessage(kDoneMsg, "Success1");
|
||||
const std::string& success2_message = CreateMessage(kDoneMsg, "Success2");
|
||||
|
@ -1043,8 +1043,8 @@ class EchoProvider : public CefResourceManager::Provider {
|
|||
// Test that many requests pending at the same time complete in the expected
|
||||
// order and return correct results.
|
||||
TEST(ResourceManagerTest, ManyRequests) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kBaseUrl[] = "http://test.com/ResourceManagerSubTest/";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
const char kBaseUrl[] = "https://test.com/ResourceManagerSubTest/";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -1148,10 +1148,10 @@ class OneShotRemovalProvider : public TestProvider {
|
|||
// Test that removal of the current provider after continue has the expected
|
||||
// results.
|
||||
TEST(ResourceManagerTest, RemoveProviderAfterContinue) {
|
||||
const char kUrl1[] = "http://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "http://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "http://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "http://test.com/ResourceManagerTest4";
|
||||
const char kUrl1[] = "https://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "https://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "https://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "https://test.com/ResourceManagerTest4";
|
||||
|
||||
const std::string& success1_message = CreateMessage(kDoneMsg, "Success1");
|
||||
const std::string& success2_message = CreateMessage(kDoneMsg, "Success2");
|
||||
|
@ -1243,10 +1243,10 @@ TEST(ResourceManagerTest, RemoveProviderAfterContinue) {
|
|||
// Test that removal of the current provider before continue has the expected
|
||||
// results.
|
||||
TEST(ResourceManagerTest, RemoveProviderBeforeContinue) {
|
||||
const char kUrl1[] = "http://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "http://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "http://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "http://test.com/ResourceManagerTest4";
|
||||
const char kUrl1[] = "https://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "https://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "https://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "https://test.com/ResourceManagerTest4";
|
||||
|
||||
const std::string& success1_message = CreateMessage(kDoneMsg, "Success1");
|
||||
const std::string& success2_message = CreateMessage(kDoneMsg, "Success2");
|
||||
|
@ -1336,10 +1336,10 @@ TEST(ResourceManagerTest, RemoveProviderBeforeContinue) {
|
|||
|
||||
// Test that removal of all providers after continue has the expected results.
|
||||
TEST(ResourceManagerTest, RemoveAllProvidersAfterContinue) {
|
||||
const char kUrl1[] = "http://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "http://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "http://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "http://test.com/ResourceManagerTest4";
|
||||
const char kUrl1[] = "https://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "https://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "https://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "https://test.com/ResourceManagerTest4";
|
||||
|
||||
const std::string& success1_message = CreateMessage(kDoneMsg, "Success1");
|
||||
const std::string& success2_message = CreateMessage(kDoneMsg, "Success2");
|
||||
|
@ -1424,10 +1424,10 @@ TEST(ResourceManagerTest, RemoveAllProvidersAfterContinue) {
|
|||
|
||||
// Test that removal of all providers before continue has the expected results.
|
||||
TEST(ResourceManagerTest, RemoveAllProvidersBeforeContinue) {
|
||||
const char kUrl1[] = "http://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "http://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "http://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "http://test.com/ResourceManagerTest4";
|
||||
const char kUrl1[] = "https://test.com/ResourceManagerTest1";
|
||||
const char kUrl2[] = "https://test.com/ResourceManagerTest2";
|
||||
const char kUrl3[] = "https://test.com/ResourceManagerTest3";
|
||||
const char kUrl4[] = "https://test.com/ResourceManagerTest4";
|
||||
|
||||
const std::string& success1_message = CreateMessage(kDoneMsg, "Success1");
|
||||
const std::string& success2_message = CreateMessage(kDoneMsg, "Success2");
|
||||
|
@ -1570,8 +1570,8 @@ std::string TestUrlFilterWithFragment(const std::string& url) {
|
|||
|
||||
// Test the URL filter capability.
|
||||
TEST(ResourceManagerTest, UrlFilter) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kExpectedUrl[] = "http://test.com/ResourceManagerTestRewrite";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
const char kExpectedUrl[] = "https://test.com/ResourceManagerTestRewrite";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -1619,10 +1619,10 @@ TEST(ResourceManagerTest, UrlFilter) {
|
|||
|
||||
// Test the URL filter capability with a query component.
|
||||
TEST(ResourceManagerTest, UrlFilterWithQuery) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest?foo=bar";
|
||||
const char kExpectedUrl[] = "http://test.com/ResourceManagerTestRewrite";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest?foo=bar";
|
||||
const char kExpectedUrl[] = "https://test.com/ResourceManagerTestRewrite";
|
||||
const char kExpectedUrlAfterFilter[] =
|
||||
"http://test.com/ResourceManagerTestRewrite?foo=bar";
|
||||
"https://test.com/ResourceManagerTestRewrite?foo=bar";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -1673,10 +1673,10 @@ TEST(ResourceManagerTest, UrlFilterWithQuery) {
|
|||
// Test the URL filter capability with a fragment component.
|
||||
TEST(ResourceManagerTest, UrlFilterWithFragment) {
|
||||
// Fragment components will not be passed with the request.
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest#fragment";
|
||||
const char kExpectedUrl[] = "http://test.com/ResourceManagerTestRewrite";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest#fragment";
|
||||
const char kExpectedUrl[] = "https://test.com/ResourceManagerTestRewrite";
|
||||
const char kExpectedUrlAfterFilter[] =
|
||||
"http://test.com/ResourceManagerTestRewrite#fragment";
|
||||
"https://test.com/ResourceManagerTestRewrite#fragment";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -1758,7 +1758,7 @@ std::string TestMimeTypeResolver(const std::string& url) {
|
|||
|
||||
// Test the mime type resolver capability.
|
||||
TEST(ResourceManagerTest, MimeTypeResolver) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -1844,7 +1844,7 @@ class AddingTestProvider : public TestProvider {
|
|||
|
||||
// Test adding a new provider after the current provider.
|
||||
TEST(ResourceManagerTest, AddProviderAfter) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
@ -1887,7 +1887,7 @@ TEST(ResourceManagerTest, AddProviderAfter) {
|
|||
|
||||
// Test adding a new provider before the current provider.
|
||||
TEST(ResourceManagerTest, AddProviderBefore) {
|
||||
const char kUrl[] = "http://test.com/ResourceManagerTest";
|
||||
const char kUrl[] = "https://test.com/ResourceManagerTest";
|
||||
|
||||
ResourceManagerTestHandler::State state;
|
||||
state.urls_.push_back(kUrl);
|
||||
|
|
|
@ -184,7 +184,7 @@ class CallbackResourceHandler : public CefResourceHandler {
|
|||
}
|
||||
|
||||
bool DoRead(void* data_out, int bytes_to_read, int& bytes_read) {
|
||||
DCHECK_GT(bytes_to_read, 0);
|
||||
EXPECT_GT(bytes_to_read, 0);
|
||||
|
||||
// Read until the buffer is full or until Read() returns 0 to indicate no
|
||||
// more data.
|
||||
|
@ -1021,13 +1021,13 @@ class BasicResponseTest : public TestHandler {
|
|||
}
|
||||
} else {
|
||||
if (url == RESULT_HTML) {
|
||||
return "http://test.com/result.html";
|
||||
return "https://test.com/result.html";
|
||||
}
|
||||
if (url == REDIRECT_HTML) {
|
||||
return "http://test.com/redirect.html";
|
||||
return "https://test.com/redirect.html";
|
||||
}
|
||||
if (url == REDIRECT2_HTML) {
|
||||
return "http://test.com/redirect2.html";
|
||||
return "https://test.com/redirect2.html";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2143,7 +2143,7 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
|||
if (custom_scheme_) {
|
||||
return "rrhcustom://test.com/main.html";
|
||||
} else {
|
||||
return "http://test.com/main.html";
|
||||
return "https://test.com/main.html";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2151,7 +2151,7 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
|||
if (custom_scheme_) {
|
||||
return "rrhcustom://test.com/subframe.html";
|
||||
} else {
|
||||
return "http://test.com/subframe.html";
|
||||
return "https://test.com/subframe.html";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2159,7 +2159,7 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
|||
if (custom_scheme_) {
|
||||
return "rrhcustom://test.com";
|
||||
} else {
|
||||
return "http://test.com";
|
||||
return "https://test.com";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2185,13 +2185,13 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
|||
}
|
||||
} else {
|
||||
if (url == RESULT_JS) {
|
||||
return "http://test.com/result.js";
|
||||
return "https://test.com/result.js";
|
||||
}
|
||||
if (url == REDIRECT_JS) {
|
||||
return "http://test.com/redirect.js";
|
||||
return "https://test.com/redirect.js";
|
||||
}
|
||||
if (url == REDIRECT2_JS) {
|
||||
return "http://test.com/redirect2.js";
|
||||
return "https://test.com/redirect2.js";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2230,7 +2230,7 @@ class SubresourceResponseTest : public RoutingTestHandler {
|
|||
}
|
||||
|
||||
std::string GetSubResponseBody() const {
|
||||
DCHECK(subframe_);
|
||||
EXPECT_TRUE(subframe_);
|
||||
|
||||
std::stringstream html;
|
||||
html << "<html><head>";
|
||||
|
@ -2681,7 +2681,7 @@ SUBRESOURCE_TEST_HANDLED_MODES(CustomHandledSubFrame, true, true)
|
|||
|
||||
namespace {
|
||||
|
||||
const char kResourceTestHtml[] = "http://test.com/resource.html";
|
||||
const char kResourceTestHtml[] = "https://test.com/resource.html";
|
||||
|
||||
class RedirectResponseTest : public TestHandler {
|
||||
public:
|
||||
|
@ -2934,8 +2934,8 @@ class RedirectResponseTest : public TestHandler {
|
|||
// With NetworkService we don't get an additional (unnecessary) redirect
|
||||
// callback.
|
||||
UrlResourceTest()
|
||||
: ResourceTest("http://test.com/start_url.js", 2U, 2U, 1U) {
|
||||
redirect_url_ = "http://test.com/redirect_url.js";
|
||||
: ResourceTest("https://test.com/start_url.js", 2U, 2U, 1U) {
|
||||
redirect_url_ = "https://test.com/redirect_url.js";
|
||||
}
|
||||
|
||||
bool CheckUrl(const std::string& url) const override {
|
||||
|
@ -2982,7 +2982,7 @@ class RedirectResponseTest : public TestHandler {
|
|||
// With NetworkService we restart the request, so we get another call to
|
||||
// OnBeforeResourceLoad.
|
||||
HeaderResourceTest()
|
||||
: ResourceTest("http://test.com/start_header.js", 2U, 2U) {
|
||||
: ResourceTest("https://test.com/start_header.js", 2U, 2U) {
|
||||
expected_headers_.insert(std::make_pair("Test-Key1", "Value1"));
|
||||
expected_headers_.insert(std::make_pair("Test-Key2", "Value2"));
|
||||
}
|
||||
|
@ -3013,7 +3013,8 @@ class RedirectResponseTest : public TestHandler {
|
|||
public:
|
||||
// With NetworkService we restart the request, so we get another call to
|
||||
// OnBeforeResourceLoad.
|
||||
PostResourceTest() : ResourceTest("http://test.com/start_post.js", 2U, 2U) {
|
||||
PostResourceTest()
|
||||
: ResourceTest("https://test.com/start_post.js", 2U, 2U) {
|
||||
CefRefPtr<CefPostDataElement> elem = CefPostDataElement::Create();
|
||||
const std::string data("Test Post Data");
|
||||
elem->SetToBytes(data.size(), data.c_str());
|
||||
|
@ -3280,7 +3281,7 @@ TEST(ResourceRequestHandlerTest, RedirectPostViaContext) {
|
|||
|
||||
namespace {
|
||||
|
||||
const char kResourceTestHtml2[] = "http://test.com/resource2.html";
|
||||
const char kResourceTestHtml2[] = "https://test.com/resource2.html";
|
||||
|
||||
class BeforeResourceLoadTest : public TestHandler {
|
||||
public:
|
||||
|
@ -3464,7 +3465,7 @@ namespace {
|
|||
// - Needing more input and not getting it.
|
||||
// - Filter error.
|
||||
|
||||
const char kResponseFilterTestUrl[] = "http://tests.com/response_filter.html";
|
||||
const char kResponseFilterTestUrl[] = "https://test.com/response_filter.html";
|
||||
|
||||
size_t GetResponseBufferSize() {
|
||||
// Match the default |capacity_num_bytes| value from
|
||||
|
@ -3872,7 +3873,7 @@ class ResponseFilterTestHandler : public TestHandler {
|
|||
CefRefPtr<CefResponse> response) override {
|
||||
EXPECT_IO_THREAD();
|
||||
|
||||
DCHECK(!got_resource_response_filter_);
|
||||
EXPECT_FALSE(got_resource_response_filter_);
|
||||
got_resource_response_filter_.yes();
|
||||
return response_filter_;
|
||||
}
|
||||
|
@ -3890,7 +3891,7 @@ class ResponseFilterTestHandler : public TestHandler {
|
|||
return;
|
||||
}
|
||||
|
||||
DCHECK(!got_resource_load_complete_);
|
||||
EXPECT_FALSE(got_resource_load_complete_);
|
||||
got_resource_load_complete_.yes();
|
||||
|
||||
status_ = status;
|
||||
|
@ -3900,7 +3901,7 @@ class ResponseFilterTestHandler : public TestHandler {
|
|||
void OnLoadEnd(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int httpStatusCode) override {
|
||||
DCHECK(!got_load_end_);
|
||||
EXPECT_FALSE(got_load_end_);
|
||||
got_load_end_.yes();
|
||||
|
||||
response_filter_->VerifyStatusCode(httpStatusCode);
|
||||
|
|
|
@ -711,7 +711,7 @@ void SetUpXHR(const XHRTestSettings& settings) {
|
|||
ss << "<html><head>"
|
||||
"<script language=\"JavaScript\">"
|
||||
"function onResult(val) {"
|
||||
" document.location = \"http://tests/exit?result=\"+val;"
|
||||
" document.location = \"https://tests/exit?result=\"+val;"
|
||||
"}"
|
||||
"function execXMLHttpRequest() {";
|
||||
if (settings.synchronous) {
|
||||
|
@ -753,7 +753,7 @@ void SetUpXHR(const XHRTestSettings& settings) {
|
|||
"</body></html>";
|
||||
g_TestResults.html = ss.str();
|
||||
|
||||
g_TestResults.exit_url = "http://tests/exit";
|
||||
g_TestResults.exit_url = "https://tests/exit";
|
||||
}
|
||||
|
||||
struct FetchTestSettings {
|
||||
|
@ -783,7 +783,7 @@ void SetUpFetch(const FetchTestSettings& settings) {
|
|||
ss << "<html><head>"
|
||||
"<script language=\"JavaScript\">"
|
||||
"function onResult(val) {"
|
||||
" document.location = \"http://tests/exit?result=\"+val;"
|
||||
" document.location = \"https://tests/exit?result=\"+val;"
|
||||
"}"
|
||||
"function execFetchHttpRequest() {";
|
||||
ss << "fetch('" << request_url.c_str()
|
||||
|
@ -808,7 +808,7 @@ void SetUpFetch(const FetchTestSettings& settings) {
|
|||
"</body></html>";
|
||||
g_TestResults.html = ss.str();
|
||||
|
||||
g_TestResults.exit_url = "http://tests/exit";
|
||||
g_TestResults.exit_url = "https://tests/exit";
|
||||
} // namespace
|
||||
|
||||
void SetUpXSS(const std::string& url,
|
||||
|
@ -837,7 +837,7 @@ void SetUpXSS(const std::string& url,
|
|||
" try {"
|
||||
" result = parent.getResult();"
|
||||
" } catch(e) { console.log(e.stack); }"
|
||||
" document.location = \"http://tests/exit?result=\"+result;"
|
||||
" document.location = \"https://tests/exit?result=\"+result;"
|
||||
"}"
|
||||
"</script>"
|
||||
"</head><body onload=\"execXSSRequest();\">"
|
||||
|
@ -865,7 +865,7 @@ void SetUpXSS(const std::string& url,
|
|||
"</body></html>";
|
||||
g_TestResults.html = ss.str();
|
||||
|
||||
g_TestResults.exit_url = "http://tests/exit";
|
||||
g_TestResults.exit_url = "https://tests/exit";
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -1512,11 +1512,11 @@ TEST(SchemeHandlerTest, CustomStandardXSSDifferentOrigin) {
|
|||
// standard scheme cannot generate XSS requests to the HTTP protocol by default.
|
||||
TEST(SchemeHandlerTest, CustomStandardXSSDifferentProtocolHttp) {
|
||||
RegisterTestScheme("customstd", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
SetUpXSS("customstd://test1/run.html", "http://test2/iframe.html");
|
||||
RegisterTestScheme("https", "test2");
|
||||
SetUpXSS("customstd://test1/run.html", "https://test2/iframe.html");
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Error: Blocked a frame with origin \"http://test2\" from accessing a "
|
||||
"Error: Blocked a frame with origin \"https://test2\" from accessing a "
|
||||
"cross-origin frame.");
|
||||
|
||||
CefRefPtr<TestSchemeHandler> handler = new TestSchemeHandler(&g_TestResults);
|
||||
|
@ -1562,9 +1562,9 @@ TEST(SchemeHandlerTest, CustomStandardXSSDifferentProtocolCustomNonStandard) {
|
|||
// Test that a cross-protocol iframe load succeeds, and that the HTTP protocol
|
||||
// cannot generate XSS requests to the custom standard scheme by default.
|
||||
TEST(SchemeHandlerTest, HttpXSSDifferentProtocolCustomStandard) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("customstd", "test2");
|
||||
SetUpXSS("http://test1/run.html", "customstd://test2/iframe.html");
|
||||
SetUpXSS("https://test1/run.html", "customstd://test2/iframe.html");
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Error: Blocked a frame with origin \"customstd://test2\" from accessing "
|
||||
|
@ -1587,9 +1587,9 @@ TEST(SchemeHandlerTest, HttpXSSDifferentProtocolCustomStandard) {
|
|||
// Test that a cross-protocol iframe load succeeds, and that the HTTP protocol
|
||||
// cannot generate XSS requests to the custom non-standard scheme by default.
|
||||
TEST(SchemeHandlerTest, HttpXSSDifferentProtocolCustomNonStandard) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("customnonstd", std::string());
|
||||
SetUpXSS("http://test1/run.html", "customnonstd:some%20value");
|
||||
SetUpXSS("https://test1/run.html", "customnonstd:some%20value");
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Error: Blocked a frame with origin \"null\" from accessing a "
|
||||
|
@ -1612,17 +1612,17 @@ TEST(SchemeHandlerTest, HttpXSSDifferentProtocolCustomNonStandard) {
|
|||
// Test that an HTTP scheme cannot generate cross-domain XHR requests by
|
||||
// default.
|
||||
TEST(SchemeHandlerTest, HttpXHRDifferentOriginSync) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
|
||||
XHRTestSettings settings;
|
||||
settings.url = "http://test1/run.html";
|
||||
settings.sub_url = "http://test2/xhr.html";
|
||||
settings.url = "https://test1/run.html";
|
||||
settings.sub_url = "https://test2/xhr.html";
|
||||
SetUpXHR(settings);
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Access to XMLHttpRequest at 'http://test2/xhr.html' from origin "
|
||||
"'http://test1' has been blocked by CORS policy: No "
|
||||
"Access to XMLHttpRequest at 'https://test2/xhr.html' from origin "
|
||||
"'https://test1' has been blocked by CORS policy: No "
|
||||
"'Access-Control-Allow-Origin' header is present on the requested "
|
||||
"resource.");
|
||||
|
||||
|
@ -1643,18 +1643,18 @@ TEST(SchemeHandlerTest, HttpXHRDifferentOriginSync) {
|
|||
// Test that an HTTP scheme cannot generate cross-domain XHR requests by
|
||||
// default.
|
||||
TEST(SchemeHandlerTest, HttpXHRDifferentOriginAsync) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
|
||||
XHRTestSettings settings;
|
||||
settings.url = "http://test1/run.html";
|
||||
settings.sub_url = "http://test2/xhr.html";
|
||||
settings.url = "https://test1/run.html";
|
||||
settings.sub_url = "https://test2/xhr.html";
|
||||
settings.synchronous = false;
|
||||
SetUpXHR(settings);
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Access to XMLHttpRequest at 'http://test2/xhr.html' from origin "
|
||||
"'http://test1' has been blocked by CORS policy: No "
|
||||
"Access to XMLHttpRequest at 'https://test2/xhr.html' from origin "
|
||||
"'https://test1' has been blocked by CORS policy: No "
|
||||
"'Access-Control-Allow-Origin' header is present on the requested "
|
||||
"resource.");
|
||||
|
||||
|
@ -1675,16 +1675,17 @@ TEST(SchemeHandlerTest, HttpXHRDifferentOriginAsync) {
|
|||
// Test that an HTTP scheme cannot generate cross-domain Fetch requests by
|
||||
// default.
|
||||
TEST(SchemeHandlerTest, HttpFetchDifferentOriginAsync) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
|
||||
FetchTestSettings settings;
|
||||
settings.url = "http://test1/run.html";
|
||||
settings.sub_url = "http://test2/fetch.html";
|
||||
settings.url = "https://test1/run.html";
|
||||
settings.sub_url = "https://test2/fetch.html";
|
||||
SetUpFetch(settings);
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Access to fetch at 'http://test2/fetch.html' from origin 'http://test1' "
|
||||
"Access to fetch at 'https://test2/fetch.html' from origin "
|
||||
"'https://test1' "
|
||||
"has been blocked by CORS policy: No 'Access-Control-Allow-Origin' "
|
||||
"header is present on the requested resource. If an opaque response "
|
||||
"serves your needs, set the request's mode to 'no-cors' to fetch the "
|
||||
|
@ -1707,12 +1708,12 @@ TEST(SchemeHandlerTest, HttpFetchDifferentOriginAsync) {
|
|||
// Test that an HTTP scheme cannot generate cross-domain XSS requests by
|
||||
// default.
|
||||
TEST(SchemeHandlerTest, HttpXSSDifferentOrigin) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
SetUpXSS("http://test1/run.html", "http://test2/xss.html");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
SetUpXSS("https://test1/run.html", "https://test2/xss.html");
|
||||
|
||||
g_TestResults.console_messages.push_back(
|
||||
"Error: Blocked a frame with origin \"http://test2\" from accessing a "
|
||||
"Error: Blocked a frame with origin \"https://test2\" from accessing a "
|
||||
"cross-origin frame.");
|
||||
|
||||
CefRefPtr<TestSchemeHandler> handler = new TestSchemeHandler(&g_TestResults);
|
||||
|
@ -2099,13 +2100,13 @@ TEST(SchemeHandlerTest, CustomStandardFetchDifferentOriginWithWhitelist3) {
|
|||
// Test that an HTTP scheme can generate cross-domain XHR requests when setting
|
||||
// the Access-Control-Allow-Origin header.
|
||||
TEST(SchemeHandlerTest, HttpXHRDifferentOriginWithHeaderSync) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
|
||||
XHRTestSettings settings;
|
||||
settings.url = "http://test1/run.html";
|
||||
settings.sub_url = "http://test2/xhr.html";
|
||||
settings.sub_allow_origin = "http://test1";
|
||||
settings.url = "https://test1/run.html";
|
||||
settings.sub_url = "https://test2/xhr.html";
|
||||
settings.sub_allow_origin = "https://test1";
|
||||
SetUpXHR(settings);
|
||||
|
||||
CefRefPtr<TestSchemeHandler> handler = new TestSchemeHandler(&g_TestResults);
|
||||
|
@ -2125,13 +2126,13 @@ TEST(SchemeHandlerTest, HttpXHRDifferentOriginWithHeaderSync) {
|
|||
// Test that an HTTP scheme can generate cross-domain XHR requests when setting
|
||||
// the Access-Control-Allow-Origin header.
|
||||
TEST(SchemeHandlerTest, HttpXHRDifferentOriginWithHeaderAsync) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
|
||||
XHRTestSettings settings;
|
||||
settings.url = "http://test1/run.html";
|
||||
settings.sub_url = "http://test2/xhr.html";
|
||||
settings.sub_allow_origin = "http://test1";
|
||||
settings.url = "https://test1/run.html";
|
||||
settings.sub_url = "https://test2/xhr.html";
|
||||
settings.sub_allow_origin = "https://test1";
|
||||
settings.synchronous = false;
|
||||
SetUpXHR(settings);
|
||||
|
||||
|
@ -2152,13 +2153,13 @@ TEST(SchemeHandlerTest, HttpXHRDifferentOriginWithHeaderAsync) {
|
|||
// Test that an HTTP scheme can generate cross-domain XHR requests when setting
|
||||
// the Access-Control-Allow-Origin header.
|
||||
TEST(SchemeHandlerTest, HttpFetchDifferentOriginWithHeader) {
|
||||
RegisterTestScheme("http", "test1");
|
||||
RegisterTestScheme("http", "test2");
|
||||
RegisterTestScheme("https", "test1");
|
||||
RegisterTestScheme("https", "test2");
|
||||
|
||||
FetchTestSettings settings;
|
||||
settings.url = "http://test1/run.html";
|
||||
settings.sub_url = "http://test2/fetch.html";
|
||||
settings.sub_allow_origin = "http://test1";
|
||||
settings.url = "https://test1/run.html";
|
||||
settings.sub_url = "https://test2/fetch.html";
|
||||
settings.sub_allow_origin = "https://test1";
|
||||
SetUpFetch(settings);
|
||||
|
||||
CefRefPtr<TestSchemeHandler> handler = new TestSchemeHandler(&g_TestResults);
|
||||
|
@ -2200,9 +2201,9 @@ TEST(SchemeHandlerTest, CustomStandardXSSDifferentOriginWithDomain) {
|
|||
// Test that an HTTP scheme can generate cross-domain XSS requests when using
|
||||
// document.domain.
|
||||
TEST(SchemeHandlerTest, HttpXSSDifferentOriginWithDomain) {
|
||||
RegisterTestScheme("http", "a.test.com");
|
||||
RegisterTestScheme("http", "b.test.com");
|
||||
SetUpXSS("http://a.test.com/run.html", "http://b.test.com/iframe.html",
|
||||
RegisterTestScheme("https", "a.test.com");
|
||||
RegisterTestScheme("https", "b.test.com");
|
||||
SetUpXSS("https://a.test.com/run.html", "https://b.test.com/iframe.html",
|
||||
"test.com");
|
||||
|
||||
CefRefPtr<TestSchemeHandler> handler = new TestSchemeHandler(&g_TestResults);
|
||||
|
|
|
@ -23,7 +23,7 @@ struct TestData {
|
|||
std::array<size_t, 50> buffer{};
|
||||
};
|
||||
|
||||
const char kSharedMessageUrl[] = "http://tests/SendSharedProcessMessageTest";
|
||||
const char kSharedMessageUrl[] = "https://tests/SendSharedProcessMessageTest";
|
||||
const char kSharedMessageName[] = "SendSharedProcessMessageTest";
|
||||
|
||||
CefRefPtr<CefProcessMessage> CreateTestMessage(const TestData& data) {
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
namespace {
|
||||
|
||||
const char kTestUrl[] = "http://tests-srh/test.html";
|
||||
const char kTestUrl[] = "https://tests-srh/test.html";
|
||||
const size_t kReadBlockSize = 1024U; // 1k.
|
||||
|
||||
// The usual network buffer size is about 32k. Choose a value that's larger.
|
||||
|
|
|
@ -188,7 +188,7 @@ class SimpleThreadTest : public ThreadTest {
|
|||
|
||||
// Test creation/execution of threads in the browser process.
|
||||
|
||||
const char kBrowserThreadTestHtml[] = "http://test.com/browserthread.html";
|
||||
const char kBrowserThreadTestHtml[] = "https://test.com/browserthread.html";
|
||||
|
||||
// Browser side.
|
||||
class BrowserThreadTestHandler : public TestHandler {
|
||||
|
@ -303,7 +303,7 @@ namespace {
|
|||
|
||||
// Test creation/execution of threads in the render process.
|
||||
|
||||
const char kRenderThreadTestHtml[] = "http://test.com/renderthread.html";
|
||||
const char kRenderThreadTestHtml[] = "https://test.com/renderthread.html";
|
||||
const char kRenderThreadTestMsg[] = "ThreadTest.RenderThreadTest";
|
||||
|
||||
// Browser side.
|
||||
|
|
|
@ -1741,7 +1741,7 @@ class RequestTestRunner : public base::RefCountedThreadSafe<RequestTestRunner> {
|
|||
|
||||
// The referrer URL must be HTTP or HTTPS. This is enforced by
|
||||
// GURL::GetAsReferrer() called from URLRequest::SetReferrer().
|
||||
settings_.request->SetReferrer("http://tests.com/referrer.html",
|
||||
settings_.request->SetReferrer("https://tests.com/referrer.html",
|
||||
REFERRER_POLICY_DEFAULT);
|
||||
|
||||
settings_.response = CefResponse::Create();
|
||||
|
|
|
@ -27,21 +27,21 @@ using client::ClientAppRenderer;
|
|||
namespace {
|
||||
|
||||
// Unique values for V8 tests.
|
||||
const char kV8TestUrl[] = "http://tests/V8Test.Test";
|
||||
const char kV8BindingTestUrl[] = "http://tests/V8Test.BindingTest";
|
||||
const char kV8ContextParentTestUrl[] = "http://tests/V8Test.ContextParentTest";
|
||||
const char kV8ContextChildTestUrl[] = "http://tests/V8Test.ContextChildTest";
|
||||
const char kV8NavTestUrl[] = "http://tests/V8Test.NavTest";
|
||||
const char kV8TestUrl[] = "https://tests/V8Test.Test";
|
||||
const char kV8BindingTestUrl[] = "https://tests/V8Test.BindingTest";
|
||||
const char kV8ContextParentTestUrl[] = "https://tests/V8Test.ContextParentTest";
|
||||
const char kV8ContextChildTestUrl[] = "https://tests/V8Test.ContextChildTest";
|
||||
const char kV8NavTestUrl[] = "https://tests/V8Test.NavTest";
|
||||
const char kV8ContextEvalCspBypassUnsafeEval[] =
|
||||
"http://tests/V8Test.ContextEvalCspBypassUnsafeEval";
|
||||
"https://tests/V8Test.ContextEvalCspBypassUnsafeEval";
|
||||
const char kV8ContextEvalCspBypassSandbox[] =
|
||||
"http://tests/V8Test.ContextEvalCspBypassSandbox";
|
||||
"https://tests/V8Test.ContextEvalCspBypassSandbox";
|
||||
const char kV8OnUncaughtExceptionTestUrl[] =
|
||||
"http://tests/V8Test.OnUncaughtException";
|
||||
"https://tests/V8Test.OnUncaughtException";
|
||||
const char kV8HandlerCallOnReleasedContextUrl[] =
|
||||
"http://tests/V8Test.HandlerCallOnReleasedContext/main.html";
|
||||
"https://tests/V8Test.HandlerCallOnReleasedContext/main.html";
|
||||
const char kV8HandlerCallOnReleasedContextChildUrl[] =
|
||||
"http://tests/V8Test.HandlerCallOnReleasedContext/child.html";
|
||||
"https://tests/V8Test.HandlerCallOnReleasedContext/child.html";
|
||||
const char kV8TestMsg[] = "V8Test.Test";
|
||||
const char kV8TestCmdKey[] = "v8-test";
|
||||
const char kV8RunTestMsg[] = "V8Test.RunTest";
|
||||
|
@ -2957,8 +2957,8 @@ class V8RendererTest : public ClientAppRenderer::Delegate,
|
|||
<< stackTrace->GetFrame(i)->GetLineNumber() << "\n";
|
||||
}
|
||||
const char* stackFormattedShouldBe =
|
||||
"at test2() in http://tests/V8Test.OnUncaughtException on line 3\n"
|
||||
"at test() in http://tests/V8Test.OnUncaughtException on line 2\n";
|
||||
"at test2() in https://tests/V8Test.OnUncaughtException on line 3\n"
|
||||
"at test() in https://tests/V8Test.OnUncaughtException on line 2\n";
|
||||
EXPECT_STREQ(stackFormattedShouldBe, stackFormatted.str().c_str());
|
||||
DestroyTest();
|
||||
}
|
||||
|
@ -3247,7 +3247,7 @@ class V8TestHandler : public TestHandler {
|
|||
|
||||
const std::string& url = frame->GetURL();
|
||||
if (url != kV8NavTestUrl && url != kV8ContextParentTestUrl &&
|
||||
url.find("http://tests/") != std::string::npos) {
|
||||
url.find("https://tests/") != std::string::npos) {
|
||||
// Run the test.
|
||||
CefRefPtr<CefProcessMessage> return_msg =
|
||||
CefProcessMessage::Create(kV8RunTestMsg);
|
||||
|
|
|
@ -112,7 +112,7 @@ void TestWindowDelegate::OnWindowCreated(CefRefPtr<CefWindow> window) {
|
|||
} else {
|
||||
// Client area bounds calculation might have off-by-one errors on Windows
|
||||
// due to non-client frame size being calculated internally in pixels and
|
||||
// then converted to DIPs. See http://crbug.com/602692.
|
||||
// then converted to DIPs. See https://crbug.com/602692.
|
||||
EXPECT_NEAR(client_bounds.width, window_size_.width, 2);
|
||||
EXPECT_NEAR(client_bounds.height, window_size_.height, 2);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue