OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/renderer/content_settings_observer.h" | 5 #include "chrome/renderer/content_settings_observer.h" |
6 | 6 |
7 #include "chrome/common/url_constants.h" | 7 #include "chrome/common/url_constants.h" |
8 #include "content/public/common/url_constants.h" | 8 #include "content/public/common/url_constants.h" |
9 #include "extensions/common/constants.h" | 9 #include "extensions/common/constants.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/WebKit/public/platform/WebURL.h" |
11 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 12 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
12 #include "url/gurl.h" | 13 #include "url/gurl.h" |
13 | 14 |
14 using blink::WebSecurityOrigin; | 15 using blink::WebSecurityOrigin; |
15 | 16 |
16 typedef testing::Test ContentSettingsObserverTest; | 17 typedef testing::Test ContentSettingsObserverTest; |
17 | 18 |
18 TEST_F(ContentSettingsObserverTest, WhitelistedSchemes) { | 19 TEST_F(ContentSettingsObserverTest, WhitelistedSchemes) { |
19 std::string end_url = ":something"; | 20 std::string end_url = ":something"; |
20 | 21 |
(...skipping 22 matching lines...) Expand all Loading... |
43 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 44 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
44 WebSecurityOrigin::create(file_url), | 45 WebSecurityOrigin::create(file_url), |
45 GURL("file:///dir/file"))); | 46 GURL("file:///dir/file"))); |
46 | 47 |
47 GURL http_url = | 48 GURL http_url = |
48 GURL("http://server.com/path"); | 49 GURL("http://server.com/path"); |
49 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 50 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
50 WebSecurityOrigin::create(http_url), | 51 WebSecurityOrigin::create(http_url), |
51 GURL())); | 52 GURL())); |
52 } | 53 } |
OLD | NEW |