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

Side by Side Diff: chrome/test/ui/ui_layout_test.cc

Issue 8552002: net: Move UnescapeRule into the net namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « chrome/renderer/external_extension_uitest.cc ('k') | chrome_frame/utils.cc » ('j') | 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) 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 "chrome/test/ui/ui_layout_test.h" 5 #include "chrome/test/ui/ui_layout_test.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Runs the new layout test. 229 // Runs the new layout test.
230 scoped_refptr<TabProxy> tab(GetActiveTab()); 230 scoped_refptr<TabProxy> tab(GetActiveTab());
231 ASSERT_TRUE(tab.get()); 231 ASSERT_TRUE(tab.get());
232 ASSERT_TRUE(tab->NavigateToURL(*new_test_url.get())); 232 ASSERT_TRUE(tab->NavigateToURL(*new_test_url.get()));
233 std::string escaped_value = 233 std::string escaped_value =
234 WaitUntilCookieNonEmpty(tab.get(), *new_test_url.get(), 234 WaitUntilCookieNonEmpty(tab.get(), *new_test_url.get(),
235 status_cookie.c_str(), TestTimeouts::action_max_timeout_ms()); 235 status_cookie.c_str(), TestTimeouts::action_max_timeout_ms());
236 236
237 // Unescapes and normalizes the actual result. 237 // Unescapes and normalizes the actual result.
238 std::string value = net::UnescapeURLComponent(escaped_value, 238 std::string value = net::UnescapeURLComponent(escaped_value,
239 UnescapeRule::NORMAL | UnescapeRule::SPACES | 239 net::UnescapeRule::NORMAL | net::UnescapeRule::SPACES |
240 UnescapeRule::URL_SPECIAL_CHARS | UnescapeRule::CONTROL_CHARS); 240 net::UnescapeRule::URL_SPECIAL_CHARS | net::UnescapeRule::CONTROL_CHARS);
241 value += "\n"; 241 value += "\n";
242 ReplaceSubstringsAfterOffset(&value, 0, "\r", ""); 242 ReplaceSubstringsAfterOffset(&value, 0, "\r", "");
243 243
244 // Reads the expected result. First try to read from rebase directory. 244 // Reads the expected result. First try to read from rebase directory.
245 // If failed, read from original directory. 245 // If failed, read from original directory.
246 std::string expected_result_value; 246 std::string expected_result_value;
247 if (!ReadExpectedResult(rebase_result_dir_, 247 if (!ReadExpectedResult(rebase_result_dir_,
248 test_case_file_name, 248 test_case_file_name,
249 &expected_result_value) && 249 &expected_result_value) &&
250 !ReadExpectedResult(rebase_result_chromium_dir_, 250 !ReadExpectedResult(rebase_result_chromium_dir_,
(...skipping 24 matching lines...) Expand all
275 std::string* expected_result_value) { 275 std::string* expected_result_value) {
276 FilePath expected_result_path(result_dir_path); 276 FilePath expected_result_path(result_dir_path);
277 expected_result_path = expected_result_path.AppendASCII(test_case_file_name); 277 expected_result_path = expected_result_path.AppendASCII(test_case_file_name);
278 expected_result_path = expected_result_path.InsertBeforeExtension( 278 expected_result_path = expected_result_path.InsertBeforeExtension(
279 FILE_PATH_LITERAL("-expected")); 279 FILE_PATH_LITERAL("-expected"));
280 expected_result_path = 280 expected_result_path =
281 expected_result_path.ReplaceExtension(FILE_PATH_LITERAL("txt")); 281 expected_result_path.ReplaceExtension(FILE_PATH_LITERAL("txt"));
282 return file_util::ReadFileToString(expected_result_path, 282 return file_util::ReadFileToString(expected_result_path,
283 expected_result_value); 283 expected_result_value);
284 } 284 }
OLDNEW
« no previous file with comments | « chrome/renderer/external_extension_uitest.cc ('k') | chrome_frame/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698