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

Unified Diff: chrome/test/ui/ui_layout_test.cc

Issue 2863025: Revert r50798 as it seems to create ui test failures (Closed)
Patch Set: Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/ui/ui_layout_test.cc
diff --git a/chrome/test/ui/ui_layout_test.cc b/chrome/test/ui/ui_layout_test.cc
index 6c5415fc216bc9a431bd430697f4b7479568155d..73556a9bc5b6685804023881476258a61c02b6cc 100644
--- a/chrome/test/ui/ui_layout_test.cc
+++ b/chrome/test/ui/ui_layout_test.cc
@@ -156,16 +156,6 @@ void UILayoutTest::AddResourceForLayoutTest(const FilePath& parent_dir,
ASSERT_TRUE(file_util::CopyDirectory(src_dir, dest_dir, true));
}
-static size_t FindInsertPosition(const std::string& html) {
- size_t tag_start = html.find("<html");
- if (tag_start == std::string::npos)
- return 0;
- size_t tag_end = html.find(">", tag_start);
- if (tag_end == std::string::npos)
- return 0;
- return tag_end + 1;
-}
-
void UILayoutTest::RunLayoutTest(const std::string& test_case_file_name,
int port) {
SCOPED_TRACE(test_case_file_name.c_str());
@@ -185,10 +175,9 @@ void UILayoutTest::RunLayoutTest(const std::string& test_case_file_name,
ASSERT_TRUE(file_util::ReadFileToString(test_file_path, &test_html));
// Injects the layout test controller into the test HTML.
- size_t insertion_position = FindInsertPosition(test_html);
- test_html.insert(insertion_position, layout_test_controller_);
- ReplaceFirstSubstringAfterOffset(
- &test_html, insertion_position, "%COOKIE%", status_cookie.c_str());
+ test_html.insert(0, layout_test_controller_);
+ ReplaceSubstringsAfterOffset(
+ &test_html, 0, "%COOKIE%", status_cookie.c_str());
// Creates the new layout test HTML file.
FilePath new_test_file_path(new_layout_test_dir_);
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698