Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1764)

Side by Side Diff: third_party/WebKit/Source/platform/weborigin/SchemeRegistryTest.cpp

Issue 2545443002: Cleanup multiple URLSchemesSet static variables (Closed)
Patch Set: remove a test that expects lower() Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/weborigin/SchemeRegistry.h" 5 #include "platform/weborigin/SchemeRegistry.h"
6 6
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace blink { 9 namespace blink {
10 namespace { 10 namespace {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassContentSecurityPolicy( 49 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassContentSecurityPolicy(
50 kTestScheme, SchemeRegistry::PolicyAreaStyle)); 50 kTestScheme, SchemeRegistry::PolicyAreaStyle));
51 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassContentSecurityPolicy( 51 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassContentSecurityPolicy(
52 kTestScheme2, SchemeRegistry::PolicyAreaImage)); 52 kTestScheme2, SchemeRegistry::PolicyAreaImage));
53 } 53 }
54 54
55 TEST_F(SchemeRegistryTest, BypassSecureContextCheck) { 55 TEST_F(SchemeRegistryTest, BypassSecureContextCheck) {
56 const char* scheme1 = "http"; 56 const char* scheme1 = "http";
57 const char* scheme2 = "https"; 57 const char* scheme2 = "https";
58 const char* scheme3 = "random-scheme"; 58 const char* scheme3 = "random-scheme";
59 const char* scheme4 = "RANDOM-SCHEME";
60 59
61 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme1)); 60 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme1));
62 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme2)); 61 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme2));
63 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme3)); 62 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme3));
64 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme4));
65 63
66 SchemeRegistry::registerURLSchemeBypassingSecureContextCheck("random-scheme"); 64 SchemeRegistry::registerURLSchemeBypassingSecureContextCheck("random-scheme");
67 65
68 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme1)); 66 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme1));
69 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme2)); 67 EXPECT_FALSE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme2));
70 EXPECT_TRUE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme3)); 68 EXPECT_TRUE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme3));
71 EXPECT_TRUE(SchemeRegistry::schemeShouldBypassSecureContextCheck(scheme4));
72 } 69 }
73 70
74 } // namespace 71 } // namespace
75 } // namespace blink 72 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/weborigin/SchemeRegistry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698