OLD | NEW |
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_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" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 #include "webkit/glue/webkit_glue.h" | 12 #include "webkit/glue/webkit_glue.h" |
13 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" | 13 #include "webkit/tools/test_shell/simple_resource_loader_bridge.h" |
14 #include "webkit/tools/test_shell/test_shell.h" | 14 #include "webkit/tools/test_shell/test_shell.h" |
15 #include "webkit/tools/test_shell/test_shell_request_context.h" | 15 #include "webkit/tools/test_shell/test_shell_request_context.h" |
16 #include "webkit/tools/test_shell/test_shell_switches.h" | 16 #include "webkit/tools/test_shell/test_shell_switches.h" |
17 #include "webkit/tools/test_shell/test_shell_test.h" | 17 #include "webkit/tools/test_shell/test_shell_test.h" |
18 | 18 |
19 namespace { | 19 namespace { |
20 | 20 |
21 const wchar_t kTestUrlSwitch[] = L"test-url"; | 21 const char kTestUrlSwitch[] = "test-url"; |
22 | 22 |
23 // A test to help determine if any nodes have been leaked as a result of | 23 // A test to help determine if any nodes have been leaked as a result of |
24 // visiting a given URL. If enabled in WebCore, the number of leaked nodes | 24 // visiting a given URL. If enabled in WebCore, the number of leaked nodes |
25 // can be printed upon termination. This is only enabled in debug builds, so | 25 // can be printed upon termination. This is only enabled in debug builds, so |
26 // it only makes sense to run this using a debug build. | 26 // it only makes sense to run this using a debug build. |
27 // | 27 // |
28 // It will load a URL, visit about:blank, and then perform garbage collection. | 28 // It will load a URL, visit about:blank, and then perform garbage collection. |
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: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 }; | 74 }; |
75 | 75 |
76 TEST_F(NodeLeakTest, TestURL) { | 76 TEST_F(NodeLeakTest, TestURL) { |
77 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 77 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
78 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) { | 78 if (parsed_command_line.HasSwitch(kTestUrlSwitch)) { |
79 NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str()); | 79 NavigateToURL(parsed_command_line.GetSwitchValue(kTestUrlSwitch).c_str()); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 } // namespace | 83 } // namespace |
OLD | NEW |