Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: chrome/browser/extensions/extension_resource_request_policy_apitest.cc

Issue 10826134: Revert 149610 - Extension resources should only load in contexts the extension has permission to ac… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/ui/browser.h" 7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/browser_tabstrip.h" 8 #include "chrome/browser/ui/browser_tabstrip.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/base/ui_test_utils.h" 10 #include "chrome/test/base/ui_test_utils.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // A web host that has permission. 47 // A web host that has permission.
48 ui_test_utils::NavigateToURL( 48 ui_test_utils::NavigateToURL(
49 browser(), web_resource.ReplaceComponents(make_host_a_com)); 49 browser(), web_resource.ReplaceComponents(make_host_a_com));
50 std::string result; 50 std::string result;
51 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString( 51 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
52 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", 52 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"",
53 L"window.domAutomationController.send(document.title)", 53 L"window.domAutomationController.send(document.title)",
54 &result)); 54 &result));
55 EXPECT_EQ(result, "Loaded"); 55 EXPECT_EQ(result, "Loaded");
56 56
57 // A web host that does not have permission.
58 ui_test_utils::NavigateToURL(
59 browser(), web_resource.ReplaceComponents(make_host_b_com));
60 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
61 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"",
62 L"window.domAutomationController.send(document.title)",
63 &result));
64 EXPECT_EQ(result, "Image failed to load");
65
66 // A web host that loads a non-existent extension. 57 // A web host that loads a non-existent extension.
67 GURL non_existent_extension( 58 GURL non_existent_extension(
68 test_server()->GetURL( 59 test_server()->GetURL(
69 "files/extensions/api_test/extension_resource_request_policy/" 60 "files/extensions/api_test/extension_resource_request_policy/"
70 "non_existent_extension.html")); 61 "non_existent_extension.html"));
71 ui_test_utils::NavigateToURL(browser(), non_existent_extension); 62 ui_test_utils::NavigateToURL(browser(), non_existent_extension);
72 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString( 63 ASSERT_TRUE(content::ExecuteJavaScriptAndExtractString(
73 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"", 64 chrome::GetActiveWebContents(browser())->GetRenderViewHost(), L"",
74 L"window.domAutomationController.send(document.title)", 65 L"window.domAutomationController.send(document.title)",
75 &result)); 66 &result));
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 241
251 #if defined(OS_MACOSX) 242 #if defined(OS_MACOSX)
252 #define MAYBE_ExtensionAccessibleResources FLAKY_ExtensionAccessibleResources 243 #define MAYBE_ExtensionAccessibleResources FLAKY_ExtensionAccessibleResources
253 #else 244 #else
254 #define MAYBE_ExtensionAccessibleResources ExtensionAccessibleResources 245 #define MAYBE_ExtensionAccessibleResources ExtensionAccessibleResources
255 #endif 246 #endif
256 IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest, 247 IN_PROC_BROWSER_TEST_F(ExtensionResourceRequestPolicyTest,
257 MAYBE_ExtensionAccessibleResources) { 248 MAYBE_ExtensionAccessibleResources) {
258 ASSERT_TRUE(RunExtensionSubtest("accessible_cer", "main.html")) << message_; 249 ASSERT_TRUE(RunExtensionSubtest("accessible_cer", "main.html")) << message_;
259 } 250 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/extensions/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698