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

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

Issue 10117022: Cleanup of v8 extension stuff. Playback extension is only used in chrome, so move it to chrome\rend… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « webkit/support/webkit_support.gypi ('k') | webkit/tools/test_shell/test_shell_main.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) 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_path.h" 6 #include "base/file_path.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "net/http/http_cache.h" 10 #include "net/http/http_cache.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { 43 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) {
44 const std::string timeout_str = parsed_command_line.GetSwitchValueASCII( 44 const std::string timeout_str = parsed_command_line.GetSwitchValueASCII(
45 test_shell::kTestShellTimeOut); 45 test_shell::kTestShellTimeOut);
46 int timeout_ms; 46 int timeout_ms;
47 if (base::StringToInt(timeout_str, &timeout_ms) && timeout_ms > 0) 47 if (base::StringToInt(timeout_str, &timeout_ms) && timeout_ms > 0)
48 TestShell::SetFileTestTimeout(timeout_ms); 48 TestShell::SetFileTestTimeout(timeout_ms);
49 } 49 }
50 50
51 // Optionally use playback mode (for instance if running automated tests). 51 SimpleResourceLoaderBridge::Init(cache_path, net::HttpCache::NORMAL, false);
52 net::HttpCache::Mode mode =
53 parsed_command_line.HasSwitch(test_shell::kPlaybackMode) ?
54 net::HttpCache::PLAYBACK : net::HttpCache::NORMAL;
55 SimpleResourceLoaderBridge::Init(cache_path, mode, false);
56 52
57 TestShellTest::SetUp(); 53 TestShellTest::SetUp();
58 } 54 }
59 55
60 virtual void TearDown() { 56 virtual void TearDown() {
61 TestShellTest::TearDown(); 57 TestShellTest::TearDown();
62 58
63 SimpleResourceLoaderBridge::Shutdown(); 59 SimpleResourceLoaderBridge::Shutdown();
64 } 60 }
65 61
66 void NavigateToURL(const std::string& test_url) { 62 void NavigateToURL(const std::string& test_url) {
67 test_shell_->LoadURL(GURL(test_url)); 63 test_shell_->LoadURL(GURL(test_url));
68 test_shell_->WaitTestFinished(); 64 test_shell_->WaitTestFinished();
69 65
70 // Depends on TestShellTests::TearDown to load blank page and 66 // Depends on TestShellTests::TearDown to load blank page and
71 // the TestShell destructor to call garbage collection. 67 // the TestShell destructor to call garbage collection.
72 } 68 }
73 }; 69 };
74 70
75 TEST_F(NodeLeakTest, TestURL) { 71 TEST_F(NodeLeakTest, TestURL) {
76 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); 72 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess();
77 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) 73 if (parsed_command_line.HasSwitch(kTestUrlSwitch))
78 NavigateToURL(parsed_command_line.GetSwitchValueASCII(kTestUrlSwitch)); 74 NavigateToURL(parsed_command_line.GetSwitchValueASCII(kTestUrlSwitch));
79 } 75 }
80 76
81 } // namespace 77 } // namespace
OLDNEW
« no previous file with comments | « webkit/support/webkit_support.gypi ('k') | webkit/tools/test_shell/test_shell_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698