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

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

Issue 430003: Revert change that disallowed content scripts access to file:// (Closed)
Patch Set: Can't go back, only through Created 11 years, 1 month 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/browser/extensions/extension_apitest.h" 5 #include "chrome/browser/extensions/extension_apitest.h"
6 #include "chrome/common/chrome_paths.h" 6 #include "chrome/common/chrome_paths.h"
7 #include "chrome/test/ui_test_utils.h" 7 #include "chrome/test/ui_test_utils.h"
8 8
9 #if defined(OS_WIN) // TODO(asargent) get this working on linux 9 #if defined(OS_WIN) // TODO(asargent) get this working on linux
10 // Tests that we throw errors when you try using extension APIs that aren't 10 // Tests that we throw errors when you try using extension APIs that aren't
11 // supported in content scripts. 11 // supported in content scripts.
12 // 12 //
13 // If you have added a new API to extension_api.json and this test starts 13 // If you have added a new API to extension_api.json and this test starts
14 // failing, most likely you need to either mark it as "unprivileged" (if it 14 // failing, most likely you need to either mark it as "unprivileged" (if it
15 // should be available in content scripts) or update the list of privileged APIs 15 // should be available in content scripts) or update the list of privileged APIs
16 // in renderer_extension_bindings.js. 16 // in renderer_extension_bindings.js.
17 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Stubs) { 17 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Stubs) {
18 HTTPTestServer* server = StartHTTPServer();
19
20 ASSERT_TRUE(RunExtensionTest("stubs")) << message_; 18 ASSERT_TRUE(RunExtensionTest("stubs")) << message_;
21 19
22 // Navigate to a simple http:// page, which should get the content script 20 // Navigate to a simple file:// page, which should get the content script
23 // injected and run the rest of the test. 21 // injected and run the rest of the test.
24 GURL url = server->TestServerPage("file/extensions/test_file.html"); 22 FilePath test_dir;
25 ui_test_utils::NavigateToURL(browser(), url); 23 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir));
26 24 FilePath simple_html_path = test_dir.AppendASCII("simple.html");
25 ui_test_utils::NavigateToURL(browser(),
26 GURL(simple_html_path.value()));
27 ResultCatcher catcher; 27 ResultCatcher catcher;
28 ASSERT_TRUE(catcher.GetNextResult()); 28 ASSERT_TRUE(catcher.GetNextResult());
29 } 29 }
30 #endif 30 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698