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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/macros.h" | 6 #include "base/macros.h" |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 // internal pages, data URLs, regular HTTP pages, and resource URLs from | 81 // internal pages, data URLs, regular HTTP pages, and resource URLs from |
82 // extensions. | 82 // extensions. |
83 const std::string test_urls[] = { | 83 const std::string test_urls[] = { |
84 "chrome://newtab/", | 84 "chrome://newtab/", |
85 "data:text/html;charset=utf-8,<html>asdf</html>", | 85 "data:text/html;charset=utf-8,<html>asdf</html>", |
86 "chrome://version/", | 86 "chrome://version/", |
87 "about:blank", | 87 "about:blank", |
88 embedded_test_server()->GetURL(kAllUrlsTarget).spec(), | 88 embedded_test_server()->GetURL(kAllUrlsTarget).spec(), |
89 bystander->GetResourceURL("page.html").spec() | 89 bystander->GetResourceURL("page.html").spec() |
90 }; | 90 }; |
91 for (auto test_url : test_urls) | 91 for (const auto& test_url : test_urls) |
92 NavigateAndWait(test_url); | 92 NavigateAndWait(test_url); |
93 } | 93 } |
94 | 94 |
95 // Test that an extension NOT whitelisted for scripting can ask for <all_urls> | 95 // Test that an extension NOT whitelisted for scripting can ask for <all_urls> |
96 // and run scripts on non-restricted all pages. | 96 // and run scripts on non-restricted all pages. |
97 IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, RegularExtensions) { | 97 IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, RegularExtensions) { |
98 // Now verify we can script a regular http page. | 98 // Now verify we can script a regular http page. |
99 ASSERT_TRUE(StartEmbeddedTestServer()); | 99 ASSERT_TRUE(StartEmbeddedTestServer()); |
100 NavigateAndWait(embedded_test_server()->GetURL(kAllUrlsTarget).spec()); | 100 NavigateAndWait(embedded_test_server()->GetURL(kAllUrlsTarget).spec()); |
101 } | 101 } |
102 | 102 |
103 } // namespace extensions | 103 } // namespace extensions |
OLD | NEW |