| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/strings/utf_string_conversions.h" | 5 #include "base/strings/utf_string_conversions.h" |
| 6 #include "content/child/site_isolation_policy.h" | 6 #include "content/child/site_isolation_policy.h" |
| 7 #include "content/public/common/context_menu_params.h" | 7 #include "content/public/common/context_menu_params.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 9 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 10 #include "ui/base/range/range.h" | 10 #include "ui/gfx/range/range.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 | 13 |
| 14 TEST(SiteIsolationPolicyTest, IsBlockableScheme) { | 14 TEST(SiteIsolationPolicyTest, IsBlockableScheme) { |
| 15 GURL data_url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA=="); | 15 GURL data_url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA=="); |
| 16 GURL ftp_url("ftp://google.com"); | 16 GURL ftp_url("ftp://google.com"); |
| 17 GURL mailto_url("mailto:google@google.com"); | 17 GURL mailto_url("mailto:google@google.com"); |
| 18 GURL about_url("about:chrome"); | 18 GURL about_url("about:chrome"); |
| 19 GURL http_url("http://google.com"); | 19 GURL http_url("http://google.com"); |
| 20 GURL https_url("https://google.com"); | 20 GURL https_url("https://google.com"); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 EXPECT_TRUE(SiteIsolationPolicy::SniffForJS(js_data, arraysize(js_data))); | 129 EXPECT_TRUE(SiteIsolationPolicy::SniffForJS(js_data, arraysize(js_data))); |
| 130 EXPECT_FALSE( | 130 EXPECT_FALSE( |
| 131 SiteIsolationPolicy::SniffForJS(json_data, arraysize(json_data))); | 131 SiteIsolationPolicy::SniffForJS(json_data, arraysize(json_data))); |
| 132 | 132 |
| 133 // Basic bounds check. | 133 // Basic bounds check. |
| 134 EXPECT_FALSE(SiteIsolationPolicy::SniffForJS(basic_js_data, 0)); | 134 EXPECT_FALSE(SiteIsolationPolicy::SniffForJS(basic_js_data, 0)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace content | 137 } // namespace content |
| OLD | NEW |