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

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

Issue 10778044: Always enable dom automation for browser_tests. This avoids developers having to call EnableDOMAuto… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 5 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
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/stringprintf.h" 6 #include "base/stringprintf.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/extensions/extension_install_dialog.h" 9 #include "chrome/browser/extensions/extension_install_dialog.h"
10 #include "chrome/browser/extensions/extension_install_ui.h" 10 #include "chrome/browser/extensions/extension_install_ui.h"
(...skipping 14 matching lines...) Expand all
25 25
26 using content::WebContents; 26 using content::WebContents;
27 27
28 const char kWebstoreDomain[] = "cws.com"; 28 const char kWebstoreDomain[] = "cws.com";
29 const char kAppDomain[] = "app.com"; 29 const char kAppDomain[] = "app.com";
30 const char kNonAppDomain[] = "nonapp.com"; 30 const char kNonAppDomain[] = "nonapp.com";
31 31
32 class WebstoreInlineInstallTest : public InProcessBrowserTest { 32 class WebstoreInlineInstallTest : public InProcessBrowserTest {
33 public: 33 public:
34 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { 34 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
35 EnableDOMAutomation();
36
37 // We start the test server now instead of in 35 // We start the test server now instead of in
38 // SetUpInProcessBrowserTestFixture so that we can get its port number. 36 // SetUpInProcessBrowserTestFixture so that we can get its port number.
39 ASSERT_TRUE(test_server()->Start()); 37 ASSERT_TRUE(test_server()->Start());
40 38
41 InProcessBrowserTest::SetUpCommandLine(command_line);
42
43 net::HostPortPair host_port = test_server()->host_port_pair(); 39 net::HostPortPair host_port = test_server()->host_port_pair();
44 test_gallery_url_ = base::StringPrintf( 40 test_gallery_url_ = base::StringPrintf(
45 "http://%s:%d/files/extensions/api_test/webstore_inline_install", 41 "http://%s:%d/files/extensions/api_test/webstore_inline_install",
46 kWebstoreDomain, host_port.port()); 42 kWebstoreDomain, host_port.port());
47 command_line->AppendSwitchASCII( 43 command_line->AppendSwitchASCII(
48 switches::kAppsGalleryURL, test_gallery_url_); 44 switches::kAppsGalleryURL, test_gallery_url_);
49 45
50 GURL crx_url = GenerateTestServerUrl(kWebstoreDomain, "extension.crx"); 46 GURL crx_url = GenerateTestServerUrl(kWebstoreDomain, "extension.crx");
51 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 47 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
52 switches::kAppsGalleryUpdateURL, crx_url.spec()); 48 switches::kAppsGalleryUpdateURL, crx_url.spec());
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallUnpackFailureTest, 166 IN_PROC_BROWSER_TEST_F(WebstoreInlineInstallUnpackFailureTest,
171 WebstoreInlineInstallUnpackFailureTest) { 167 WebstoreInlineInstallUnpackFailureTest) {
172 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 168 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
173 switches::kAppsGalleryInstallAutoConfirmForTests, "accept"); 169 switches::kAppsGalleryInstallAutoConfirmForTests, "accept");
174 170
175 ui_test_utils::NavigateToURL(browser(), 171 ui_test_utils::NavigateToURL(browser(),
176 GenerateTestServerUrl(kAppDomain, "install_unpack_failure.html")); 172 GenerateTestServerUrl(kAppDomain, "install_unpack_failure.html"));
177 173
178 RunInlineInstallTest("runTest"); 174 RunInlineInstallTest("runTest");
179 } 175 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_startup_browsertest.cc ('k') | chrome/browser/geolocation/geolocation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698