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 "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/base/ui_test_utils.h" | 7 #include "chrome/test/base/ui_test_utils.h" |
8 #include "googleurl/src/gurl.h" | 8 #include "googleurl/src/gurl.h" |
9 #include "net/test/spawned_test_server/spawned_test_server.h" | 9 #include "net/test/embedded_test_server/embedded_test_server.h" |
10 | 10 |
11 // Tests that we throw errors when you try using extension APIs that aren't | 11 // Tests that we throw errors when you try using extension APIs that aren't |
12 // supported in content scripts. | 12 // supported in content scripts. |
13 // Timey-outy on mac. http://crbug.com/89116 | 13 // Timey-outy on mac. http://crbug.com/89116 |
14 #if defined(OS_MACOSX) | 14 #if defined(OS_MACOSX) |
15 #define MAYBE_Stubs DISABLED_Stubs | 15 #define MAYBE_Stubs DISABLED_Stubs |
16 #else | 16 #else |
17 #define MAYBE_Stubs Stubs | 17 #define MAYBE_Stubs Stubs |
18 #endif | 18 #endif |
19 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Stubs) { | 19 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Stubs) { |
20 ASSERT_TRUE(test_server()->Start()); | 20 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); |
21 | 21 |
22 ASSERT_TRUE(RunExtensionTest("stubs")) << message_; | 22 ASSERT_TRUE(RunExtensionTest("stubs")) << message_; |
23 | 23 |
24 // Navigate to a simple http:// page, which should get the content script | 24 // Navigate to a simple http:// page, which should get the content script |
25 // injected and run the rest of the test. | 25 // injected and run the rest of the test. |
26 GURL url(test_server()->GetURL("file/extensions/test_file.html")); | 26 GURL url(embedded_test_server()->GetURL("/extensions/test_file.html")); |
27 ui_test_utils::NavigateToURL(browser(), url); | 27 ui_test_utils::NavigateToURL(browser(), url); |
28 | 28 |
29 ResultCatcher catcher; | 29 ResultCatcher catcher; |
30 ASSERT_TRUE(catcher.GetNextResult()); | 30 ASSERT_TRUE(catcher.GetNextResult()); |
31 } | 31 } |
OLD | NEW |