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

Side by Side Diff: content/test/browser_test_base.cc

Issue 10820007: Move all the layout tests that ran under browser_tests to run under content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac 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) 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 "content/test/browser_test_base.h" 5 #include "content/test/browser_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "content/public/common/main_function_params.h" 10 #include "content/public/common/main_function_params.h"
(...skipping 15 matching lines...) Expand all
26 26
27 BrowserTestBase::~BrowserTestBase() { 27 BrowserTestBase::~BrowserTestBase() {
28 } 28 }
29 29
30 void BrowserTestBase::SetUp() { 30 void BrowserTestBase::SetUp() {
31 CommandLine* command_line = CommandLine::ForCurrentProcess(); 31 CommandLine* command_line = CommandLine::ForCurrentProcess();
32 32
33 // The tests assume that file:// URIs can freely access other file:// URIs. 33 // The tests assume that file:// URIs can freely access other file:// URIs.
34 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles); 34 command_line->AppendSwitch(switches::kAllowFileAccessFromFiles);
35 35
36 command_line->AppendSwitch(switches::kDomAutomationController);
37
36 content::MainFunctionParams params(*command_line); 38 content::MainFunctionParams params(*command_line);
37 params.ui_task = 39 params.ui_task =
38 new base::Closure( 40 new base::Closure(
39 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this)); 41 base::Bind(&BrowserTestBase::ProxyRunTestOnMainThreadLoop, this));
40 42
41 SetUpInProcessBrowserTestFixture(); 43 SetUpInProcessBrowserTestFixture();
42 BrowserMain(params); 44 BrowserMain(params);
43 TearDownInProcessBrowserTestFixture(); 45 TearDownInProcessBrowserTestFixture();
44 } 46 }
45 47
46 void BrowserTestBase::TearDown() { 48 void BrowserTestBase::TearDown() {
47 } 49 }
48 50
49 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() { 51 void BrowserTestBase::ProxyRunTestOnMainThreadLoop() {
50 RunTestOnMainThreadLoop(); 52 RunTestOnMainThreadLoop();
51 } 53 }
54
55 void BrowserTestBase::CreateTestServer(const char* test_server_base) {
56 CHECK(!test_server_.get());
57 test_server_.reset(new net::TestServer(
58 net::TestServer::TYPE_HTTP,
59 net::TestServer::kLocalhost,
60 FilePath().AppendASCII(test_server_base)));
61 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698