Index: third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp |
diff --git a/third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp b/third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp |
index 45386104ccbc12e5408d0feae167d7aba09cec87..957ac7b9003aeab7168f031443da80a48a460450 100644 |
--- a/third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp |
+++ b/third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp |
@@ -50,5 +50,25 @@ TEST_F(SchemeRegistryTest, PartialCSPBypass) |
EXPECT_FALSE(SchemeRegistry::schemeShouldBypassContentSecurityPolicy(kTestScheme2, SchemeRegistry::PolicyAreaImage)); |
} |
+TEST_F(SchemeRegistryTest, BypassSecureContextCheck) |
+{ |
+ const char* scheme1 = "http"; |
+ const char* scheme2 = "https"; |
+ const char* scheme3 = "random-scheme"; |
+ const char* scheme4 = "RANDOM-SCHEME"; |
+ |
+ EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme1)); |
+ EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme2)); |
+ EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme3)); |
+ EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme4)); |
+ |
+ SchemeRegistry::registerURLSchemeBypassingSecureContextCheck("random-scheme"); |
+ |
+ EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme1)); |
+ EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme2)); |
+ EXPECT_TRUE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme3)); |
+ EXPECT_TRUE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme4)); |
+} |
+ |
} // namespace |
} // namespace blink |