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

Side by Side Diff: content/test/layout_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
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "content/test/layout_browsertest.h" 5 #include "content/test/layout_browsertest.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/rand_util.h" 10 #include "base/rand_util.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 "window.testRunner = window.layoutTestController;\n" 88 "window.testRunner = window.layoutTestController;\n"
89 "window.addEventListener('load', layoutTestController.OnEvent, false);\n" 89 "window.addEventListener('load', layoutTestController.OnEvent, false);\n"
90 "</script>"; 90 "</script>";
91 91
92 } 92 }
93 93
94 InProcessBrowserLayoutTest::InProcessBrowserLayoutTest( 94 InProcessBrowserLayoutTest::InProcessBrowserLayoutTest(
95 const FilePath& test_parent_dir, const FilePath& test_case_dir) 95 const FilePath& test_parent_dir, const FilePath& test_case_dir)
96 : test_parent_dir_(test_parent_dir), test_case_dir_(test_case_dir), 96 : test_parent_dir_(test_parent_dir), test_case_dir_(test_case_dir),
97 port_(-2) { 97 port_(-2) {
98 EnableDOMAutomation();
99 } 98 }
100 99
101 InProcessBrowserLayoutTest::InProcessBrowserLayoutTest( 100 InProcessBrowserLayoutTest::InProcessBrowserLayoutTest(
102 const FilePath& test_parent_dir, const FilePath& test_case_dir, int port) 101 const FilePath& test_parent_dir, const FilePath& test_case_dir, int port)
103 : test_parent_dir_(test_parent_dir), test_case_dir_(test_case_dir), 102 : test_parent_dir_(test_parent_dir), test_case_dir_(test_case_dir),
104 port_(port) { 103 port_(port) {
105 EnableDOMAutomation();
106 } 104 }
107 105
108 InProcessBrowserLayoutTest::~InProcessBrowserLayoutTest() { 106 InProcessBrowserLayoutTest::~InProcessBrowserLayoutTest() {
109 if (test_http_server_.get()) 107 if (test_http_server_.get())
110 CHECK(test_http_server_->Stop()); 108 CHECK(test_http_server_->Stop());
111 } 109 }
112 110
113 void InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture() { 111 void InProcessBrowserLayoutTest::SetUpInProcessBrowserTestFixture() {
114 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir()); 112 ASSERT_TRUE(scoped_temp_dir_.CreateUniqueTempDir());
115 FilePath src_dir; 113 FilePath src_dir;
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 ASSERT_TRUE(file_util::ReadFileToString(path_to_single_test, &test_html)); 252 ASSERT_TRUE(file_util::ReadFileToString(path_to_single_test, &test_html));
255 253
256 size_t insertion_position = FindInsertPosition(test_html); 254 size_t insertion_position = FindInsertPosition(test_html);
257 test_html.insert(insertion_position, preamble); 255 test_html.insert(insertion_position, preamble);
258 *test_path = our_layout_test_temp_dir_.Append(test_case_dir_); 256 *test_path = our_layout_test_temp_dir_.Append(test_case_dir_);
259 *test_path = test_path->AppendASCII(test_case_file_name); 257 *test_path = test_path->AppendASCII(test_case_file_name);
260 ASSERT_TRUE(file_util::WriteFile(*test_path, 258 ASSERT_TRUE(file_util::WriteFile(*test_path,
261 &test_html.at(0), 259 &test_html.at(0),
262 static_cast<int>(test_html.size()))); 260 static_cast<int>(test_html.size())));
263 } 261 }
OLDNEW
« no previous file with comments | « content/browser/session_history_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698