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" |
(...skipping 13 matching lines...) Expand all Loading... |
24 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 24 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
25 WebSecurityOrigin::create(chrome_ui_url), | 25 WebSecurityOrigin::create(chrome_ui_url), |
26 GURL())); | 26 GURL())); |
27 | 27 |
28 GURL chrome_dev_tools_url = | 28 GURL chrome_dev_tools_url = |
29 GURL(std::string(chrome::kChromeDevToolsScheme).append(end_url)); | 29 GURL(std::string(chrome::kChromeDevToolsScheme).append(end_url)); |
30 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 30 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
31 WebSecurityOrigin::create(chrome_dev_tools_url), | 31 WebSecurityOrigin::create(chrome_dev_tools_url), |
32 GURL())); | 32 GURL())); |
33 | 33 |
| 34 GURL dom_distiller_url = |
| 35 GURL(std::string(chrome::kDomDistillerScheme).append(end_url)); |
| 36 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
| 37 WebSecurityOrigin::create(dom_distiller_url), |
| 38 GURL())); |
| 39 |
34 GURL extension_url = | 40 GURL extension_url = |
35 GURL(std::string(extensions::kExtensionScheme).append(end_url)); | 41 GURL(std::string(extensions::kExtensionScheme).append(end_url)); |
36 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 42 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
37 WebSecurityOrigin::create(extension_url), | 43 WebSecurityOrigin::create(extension_url), |
38 GURL())); | 44 GURL())); |
39 | 45 |
40 GURL file_url("file:///dir/"); | 46 GURL file_url("file:///dir/"); |
41 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 47 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
42 WebSecurityOrigin::create(file_url), | 48 WebSecurityOrigin::create(file_url), |
43 GURL("file:///dir/"))); | 49 GURL("file:///dir/"))); |
44 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 50 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
45 WebSecurityOrigin::create(file_url), | 51 WebSecurityOrigin::create(file_url), |
46 GURL("file:///dir/file"))); | 52 GURL("file:///dir/file"))); |
47 | 53 |
48 GURL http_url = | 54 GURL http_url = |
49 GURL("http://server.com/path"); | 55 GURL("http://server.com/path"); |
50 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 56 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
51 WebSecurityOrigin::create(http_url), | 57 WebSecurityOrigin::create(http_url), |
52 GURL())); | 58 GURL())); |
53 } | 59 } |
OLD | NEW |