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

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

Issue 1409163006: Migrating tests to use EmbeddedTestServer (/chrome/browser misc) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 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) 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 "extensions/test/result_catcher.h" 8 #include "extensions/test/result_catcher.h"
9 #include "net/test/embedded_test_server/embedded_test_server.h" 9 #include "net/test/embedded_test_server/embedded_test_server.h"
10 #include "url/gurl.h" 10 #include "url/gurl.h"
11 11
12 // Tests that we throw errors when you try using extension APIs that aren't 12 // Tests that we throw errors when you try using extension APIs that aren't
13 // supported in content scripts. 13 // supported in content scripts.
14 // Timey-outy on mac. http://crbug.com/89116 14 // Timey-outy on mac. http://crbug.com/89116
15 #if defined(OS_MACOSX) 15 #if defined(OS_MACOSX)
16 #define MAYBE_Stubs DISABLED_Stubs 16 #define MAYBE_Stubs DISABLED_Stubs
17 #else 17 #else
18 #define MAYBE_Stubs Stubs 18 #define MAYBE_Stubs Stubs
19 #endif 19 #endif
20 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Stubs) { 20 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Stubs) {
21 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); 21 ASSERT_TRUE(embedded_test_server()->Start());
22 22
23 ASSERT_TRUE(RunExtensionTest("stubs")) << message_; 23 ASSERT_TRUE(RunExtensionTest("stubs")) << message_;
24 24
25 // Navigate to a simple http:// page, which should get the content script 25 // Navigate to a simple http:// page, which should get the content script
26 // injected and run the rest of the test. 26 // injected and run the rest of the test.
27 GURL url(embedded_test_server()->GetURL("/extensions/test_file.html")); 27 GURL url(embedded_test_server()->GetURL("/extensions/test_file.html"));
28 ui_test_utils::NavigateToURL(browser(), url); 28 ui_test_utils::NavigateToURL(browser(), url);
29 29
30 extensions::ResultCatcher catcher; 30 extensions::ResultCatcher catcher;
31 ASSERT_TRUE(catcher.GetNextResult()); 31 ASSERT_TRUE(catcher.GetNextResult());
32 } 32 }
33 33
34 // Tests that all API features that are available to a platform app actually 34 // Tests that all API features that are available to a platform app actually
35 // can be used in an app. For example, this test will fail if a developer adds 35 // can be used in an app. For example, this test will fail if a developer adds
36 // an API feature without providing a schema. http://crbug.com/369318 36 // an API feature without providing a schema. http://crbug.com/369318
37 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, StubsApp) { 37 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, StubsApp) {
38 ASSERT_TRUE(RunPlatformAppTestWithFlags( 38 ASSERT_TRUE(RunPlatformAppTestWithFlags(
39 "stubs_app", static_cast<int>(kFlagIgnoreManifestWarnings))) 39 "stubs_app", static_cast<int>(kFlagIgnoreManifestWarnings)))
40 << message_; 40 << message_;
41 } 41 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698