| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/extension_apitest.h" |
| 6 #include "chrome/common/chrome_paths.h" |
| 7 #include "chrome/test/ui_test_utils.h" |
| 8 |
| 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 |
| 11 // supported in content scripts. |
| 12 // |
| 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 |
| 15 // should be available in content scripts) or update the list of privileged APIs |
| 16 // in renderer_extension_bindings.js. |
| 17 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, Stubs) { |
| 18 ASSERT_TRUE(RunExtensionTest("stubs")) << message_; |
| 19 |
| 20 // Navigate to a simple file:// page, which should get the content script |
| 21 // injected and run the rest of the test. |
| 22 FilePath test_dir; |
| 23 ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &test_dir)); |
| 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; |
| 28 ASSERT_TRUE(catcher.GetNextResult()); |
| 29 } |
| 30 #endif |
| OLD | NEW |