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/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
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/process_util.h" | 9 #include "base/process_util.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #define BASE_URL L"http://localhost:8000" | 31 #define BASE_URL L"http://localhost:8000" |
32 | 32 |
33 namespace { | 33 namespace { |
34 | 34 |
35 class PageCyclerTest : public UITest { | 35 class PageCyclerTest : public UITest { |
36 public: | 36 public: |
37 PageCyclerTest() { | 37 PageCyclerTest() { |
38 show_window_ = true; | 38 show_window_ = true; |
39 | 39 |
40 // Expose garbage collection for the page cycler tests. | 40 // Expose garbage collection for the page cycler tests. |
41 CommandLine::AppendSwitchWithValue(&launch_arguments_, | 41 launch_arguments_.AppendSwitchWithValue(switches::kJavaScriptFlags, |
42 switches::kJavaScriptFlags, | 42 L"--expose_gc"); |
43 L"--expose_gc"); | |
44 } | 43 } |
45 | 44 |
46 // For HTTP tests, the name must be safe for use in a URL without escaping. | 45 // For HTTP tests, the name must be safe for use in a URL without escaping. |
47 void RunPageCycler(const wchar_t* name, std::wstring* pages, | 46 void RunPageCycler(const wchar_t* name, std::wstring* pages, |
48 std::wstring* timings, bool use_http) { | 47 std::wstring* timings, bool use_http) { |
49 GURL test_url; | 48 GURL test_url; |
50 if (use_http) { | 49 if (use_http) { |
51 std::wstring test_path(BASE_URL); | 50 std::wstring test_path(BASE_URL); |
52 file_util::AppendToPath(&test_path, name); | 51 file_util::AppendToPath(&test_path, name); |
53 file_util::AppendToPath(&test_path, L"start.html"); | 52 file_util::AppendToPath(&test_path, L"start.html"); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 } | 320 } |
322 | 321 |
323 TEST_F(PageCyclerTest, BloatHttp) { | 322 TEST_F(PageCyclerTest, BloatHttp) { |
324 RunTest(L"bloat", true); | 323 RunTest(L"bloat", true); |
325 } | 324 } |
326 | 325 |
327 TEST_F(PageCyclerReferenceTest, BloatHttp) { | 326 TEST_F(PageCyclerReferenceTest, BloatHttp) { |
328 RunTest(L"bloat", true); | 327 RunTest(L"bloat", true); |
329 } | 328 } |
330 | 329 |
OLD | NEW |