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