OLD | NEW |
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 <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 SaveResults(expected_text, actual_text); | 189 SaveResults(expected_text, actual_text); |
190 } else { | 190 } else { |
191 EXPECT_EQ(expected_text, actual_text); | 191 EXPECT_EQ(expected_text, actual_text); |
192 } | 192 } |
193 } | 193 } |
194 | 194 |
195 std::string InProcessBrowserLayoutTest::SaveResults(const std::string& expected, | 195 std::string InProcessBrowserLayoutTest::SaveResults(const std::string& expected, |
196 const std::string& actual) { | 196 const std::string& actual) { |
197 base::FilePath cwd; | 197 base::FilePath cwd; |
198 EXPECT_TRUE(file_util::CreateNewTempDirectory( | 198 EXPECT_TRUE(file_util::CreateNewTempDirectory( |
199 FILE_PATH_LITERAL(std::string()), &cwd)); | 199 base::FilePath::StringType(), &cwd)); |
200 base::FilePath expected_filename = | 200 base::FilePath expected_filename = |
201 cwd.Append(FILE_PATH_LITERAL("expected.txt")); | 201 cwd.Append(FILE_PATH_LITERAL("expected.txt")); |
202 base::FilePath actual_filename = cwd.Append(FILE_PATH_LITERAL("actual.txt")); | 202 base::FilePath actual_filename = cwd.Append(FILE_PATH_LITERAL("actual.txt")); |
203 EXPECT_NE(-1, file_util::WriteFile(expected_filename, | 203 EXPECT_NE(-1, file_util::WriteFile(expected_filename, |
204 expected.c_str(), | 204 expected.c_str(), |
205 expected.size())); | 205 expected.size())); |
206 EXPECT_NE(-1, file_util::WriteFile(actual_filename, | 206 EXPECT_NE(-1, file_util::WriteFile(actual_filename, |
207 actual.c_str(), | 207 actual.c_str(), |
208 actual.size())); | 208 actual.size())); |
209 return base::StringPrintf("Wrote %"PRFilePath" %"PRFilePath, | 209 return base::StringPrintf("Wrote %"PRFilePath" %"PRFilePath, |
210 expected_filename.value().c_str(), | 210 expected_filename.value().c_str(), |
211 actual_filename.value().c_str()); | 211 actual_filename.value().c_str()); |
212 } | 212 } |
213 | 213 |
214 } // namespace content | 214 } // namespace content |
OLD | NEW |