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

Side by Side Diff: webkit/tools/test_shell/node_leak_test.cc

Issue 28281: Get rid of wstring variants of StringToFoo. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_util.h" 6 #include "base/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "net/http/http_cache.h" 9 #include "net/http/http_cache.h"
10 #include "net/url_request/url_request_context.h" 10 #include "net/url_request/url_request_context.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 std::wstring cache_path = 42 std::wstring cache_path =
43 parsed_command_line.GetSwitchValue(test_shell::kCacheDir); 43 parsed_command_line.GetSwitchValue(test_shell::kCacheDir);
44 if (cache_path.empty()) { 44 if (cache_path.empty()) {
45 PathService::Get(base::DIR_EXE, &cache_path); 45 PathService::Get(base::DIR_EXE, &cache_path);
46 file_util::AppendToPath(&cache_path, L"cache"); 46 file_util::AppendToPath(&cache_path, L"cache");
47 } 47 }
48 48
49 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { 49 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) {
50 const std::wstring timeout_str = parsed_command_line.GetSwitchValue( 50 const std::wstring timeout_str = parsed_command_line.GetSwitchValue(
51 test_shell::kTestShellTimeOut); 51 test_shell::kTestShellTimeOut);
52 int timeout_ms = static_cast<int>(StringToInt64(timeout_str.c_str())); 52 int timeout_ms =
53 static_cast<int>(StringToInt64(WideToUTF16Hack(timeout_str.c_str())));
53 if (timeout_ms > 0) 54 if (timeout_ms > 0)
54 TestShell::SetFileTestTimeout(timeout_ms); 55 TestShell::SetFileTestTimeout(timeout_ms);
55 } 56 }
56 57
57 // Optionally use playback mode (for instance if running automated tests). 58 // Optionally use playback mode (for instance if running automated tests).
58 net::HttpCache::Mode mode = 59 net::HttpCache::Mode mode =
59 parsed_command_line.HasSwitch(test_shell::kPlaybackMode) ? 60 parsed_command_line.HasSwitch(test_shell::kPlaybackMode) ?
60 net::HttpCache::PLAYBACK : net::HttpCache::NORMAL; 61 net::HttpCache::PLAYBACK : net::HttpCache::NORMAL;
61 SimpleResourceLoaderBridge::Init( 62 SimpleResourceLoaderBridge::Init(
62 new TestShellRequestContext(cache_path, mode, false)); 63 new TestShellRequestContext(cache_path, mode, false));
(...skipping 17 matching lines...) Expand all
80 }; 81 };
81 82
82 TEST_F(NodeLeakTest, TestURL) { 83 TEST_F(NodeLeakTest, TestURL) {
83 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 84 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
84 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) { 85 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) {
85 NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str()); 86 NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str());
86 } 87 }
87 } 88 }
88 89
89 } // namespace 90 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698