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

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

Issue 10719: Add GCController support to test_shell.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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
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 18 matching lines...) Expand all
29 // The number of remaining (potentially leaked) nodes will be printed on exit. 29 // The number of remaining (potentially leaked) nodes will be printed on exit.
30 class NodeLeakTest : public TestShellTest { 30 class NodeLeakTest : public TestShellTest {
31 public: 31 public:
32 virtual void SetUp() { 32 virtual void SetUp() {
33 CommandLine parsed_command_line; 33 CommandLine parsed_command_line;
34 34
35 std::wstring js_flags = 35 std::wstring js_flags =
36 parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags); 36 parsed_command_line.GetSwitchValue(test_shell::kJavaScriptFlags);
37 CommandLine::AppendSwitch(&js_flags, L"expose-gc"); 37 CommandLine::AppendSwitch(&js_flags, L"expose-gc");
38 webkit_glue::SetJavaScriptFlags(js_flags); 38 webkit_glue::SetJavaScriptFlags(js_flags);
39 // Expose GCController to JavaScript as well.
40 webkit_glue::SetShouldExposeGCController(true);
39 41
40 std::wstring cache_path = 42 std::wstring cache_path =
41 parsed_command_line.GetSwitchValue(test_shell::kCacheDir); 43 parsed_command_line.GetSwitchValue(test_shell::kCacheDir);
42 if (cache_path.empty()) { 44 if (cache_path.empty()) {
43 PathService::Get(base::DIR_EXE, &cache_path); 45 PathService::Get(base::DIR_EXE, &cache_path);
44 file_util::AppendToPath(&cache_path, L"cache"); 46 file_util::AppendToPath(&cache_path, L"cache");
45 } 47 }
46 48
47 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) { 49 if (parsed_command_line.HasSwitch(test_shell::kTestShellTimeOut)) {
48 const std::wstring timeout_str = parsed_command_line.GetSwitchValue( 50 const std::wstring timeout_str = parsed_command_line.GetSwitchValue(
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } // namespace 82 } // namespace
81 83
82 TEST_F(NodeLeakTest, TestURL) { 84 TEST_F(NodeLeakTest, TestURL) {
83 CommandLine parsed_command_line; 85 CommandLine parsed_command_line;
84 86
85 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) { 87 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) {
86 NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str()); 88 NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str());
87 } 89 }
88 } 90 }
89 91
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698