| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "chrome/browser/extensions/extension_apitest.h" | 7 #include "chrome/browser/extensions/extension_apitest.h" |
| 8 #include "chrome/browser/extensions/test_extension_dir.h" | 8 #include "chrome/browser/extensions/test_extension_dir.h" |
| 9 #include "chrome/browser/ui/browser_navigator_params.h" | 9 #include "chrome/browser/ui/browser_navigator_params.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 "}"); | 88 "}"); |
| 89 const Extension* extension = WriteFilesAndLoadTestExtension(&dir); | 89 const Extension* extension = WriteFilesAndLoadTestExtension(&dir); |
| 90 ASSERT_TRUE(extension); | 90 ASSERT_TRUE(extension); |
| 91 | 91 |
| 92 EXPECT_EQ( | 92 EXPECT_EQ( |
| 93 "text content", | 93 "text content", |
| 94 ExecuteScriptInBackgroundPage( | 94 ExecuteScriptInBackgroundPage( |
| 95 extension->id(), GetFetchScript("chrome.runtime.getURL('text')"))); | 95 extension->id(), GetFetchScript("chrome.runtime.getURL('text')"))); |
| 96 } | 96 } |
| 97 | 97 |
| 98 IN_PROC_BROWSER_TEST_F(ExtensionFetchTest, | 98 // Disabled: https://crbug.com/709466 |
| 99 ExtensionCanFetchHostedResourceWithHostPermissions) { | 99 IN_PROC_BROWSER_TEST_F( |
| 100 ExtensionFetchTest, |
| 101 DISABLED_ExtensionCanFetchHostedResourceWithHostPermissions) { |
| 100 TestExtensionDir dir; | 102 TestExtensionDir dir; |
| 101 dir.WriteManifestWithSingleQuotes( | 103 dir.WriteManifestWithSingleQuotes( |
| 102 "{" | 104 "{" |
| 103 "'background': {'scripts': ['bg.js']}," | 105 "'background': {'scripts': ['bg.js']}," |
| 104 "'manifest_version': 2," | 106 "'manifest_version': 2," |
| 105 "'name': 'ExtensionCanFetchHostedResourceWithHostPermissions'," | 107 "'name': 'ExtensionCanFetchHostedResourceWithHostPermissions'," |
| 106 "'permissions': ['http://example.com/*']," | 108 "'permissions': ['http://example.com/*']," |
| 107 "'version': '1'" | 109 "'version': '1'" |
| 108 "}"); | 110 "}"); |
| 109 const Extension* extension = WriteFilesAndLoadTestExtension(&dir); | 111 const Extension* extension = WriteFilesAndLoadTestExtension(&dir); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 ASSERT_TRUE(content::ExecuteScriptAndExtractString( | 187 ASSERT_TRUE(content::ExecuteScriptAndExtractString( |
| 186 empty_tab, | 188 empty_tab, |
| 187 GetFetchScript(GetQuotedURL(extension->GetResourceURL("text"))), | 189 GetFetchScript(GetQuotedURL(extension->GetResourceURL("text"))), |
| 188 &fetch_result)); | 190 &fetch_result)); |
| 189 EXPECT_EQ("TypeError: Failed to fetch", fetch_result); | 191 EXPECT_EQ("TypeError: Failed to fetch", fetch_result); |
| 190 } | 192 } |
| 191 | 193 |
| 192 } // namespace | 194 } // namespace |
| 193 | 195 |
| 194 } // namespace extensions | 196 } // namespace extensions |
| OLD | NEW |