| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 GURL())); | 42 GURL())); |
| 43 | 43 |
| 44 GURL file_url("file:///dir/"); | 44 GURL file_url("file:///dir/"); |
| 45 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 45 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
| 46 WebSecurityOrigin::create(file_url), | 46 WebSecurityOrigin::create(file_url), |
| 47 GURL("file:///dir/"))); | 47 GURL("file:///dir/"))); |
| 48 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 48 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
| 49 WebSecurityOrigin::create(file_url), | 49 WebSecurityOrigin::create(file_url), |
| 50 GURL("file:///dir/file"))); | 50 GURL("file:///dir/file"))); |
| 51 | 51 |
| 52 GURL ftp_url("ftp:///dir/"); | |
| 53 EXPECT_TRUE(ContentSettingsObserver::IsWhitelistedForContentSettings( | |
| 54 WebSecurityOrigin::create(ftp_url), | |
| 55 GURL("ftp:///dir/"))); | |
| 56 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | |
| 57 WebSecurityOrigin::create(ftp_url), | |
| 58 GURL("ftp:///dir/file"))); | |
| 59 | |
| 60 GURL http_url = | 52 GURL http_url = |
| 61 GURL("http://server.com/path"); | 53 GURL("http://server.com/path"); |
| 62 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( | 54 EXPECT_FALSE(ContentSettingsObserver::IsWhitelistedForContentSettings( |
| 63 WebSecurityOrigin::create(http_url), | 55 WebSecurityOrigin::create(http_url), |
| 64 GURL())); | 56 GURL())); |
| 65 } | 57 } |
| OLD | NEW |