| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" |
| 8 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 9 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| 10 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 11 #include "chrome/browser/net/url_fixer_upper.h" | 12 #include "chrome/browser/net/url_fixer_upper.h" |
| 12 #include "chrome/common/chrome_constants.h" | 13 #include "chrome/common/chrome_constants.h" |
| 13 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
| 14 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
| 15 #include "chrome/test/automation/tab_proxy.h" | 16 #include "chrome/test/automation/tab_proxy.h" |
| 16 #include "chrome/test/automation/window_proxy.h" | 17 #include "chrome/test/automation/window_proxy.h" |
| 17 #include "chrome/test/chrome_process_util.h" | 18 #include "chrome/test/chrome_process_util.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 test_url = GURL(std::string(kBaseUrl) + name + "/start.html"); | 50 test_url = GURL(std::string(kBaseUrl) + name + "/start.html"); |
| 50 } else { | 51 } else { |
| 51 FilePath test_path; | 52 FilePath test_path; |
| 52 PathService::Get(base::DIR_EXE, &test_path); | 53 PathService::Get(base::DIR_EXE, &test_path); |
| 53 test_path = test_path.DirName(); | 54 test_path = test_path.DirName(); |
| 54 test_path = test_path.DirName(); | 55 test_path = test_path.DirName(); |
| 55 test_path = test_path.Append(FILE_PATH_LITERAL("data")); | 56 test_path = test_path.Append(FILE_PATH_LITERAL("data")); |
| 56 test_path = test_path.Append(FILE_PATH_LITERAL("page_cycler")); | 57 test_path = test_path.Append(FILE_PATH_LITERAL("page_cycler")); |
| 57 test_path = test_path.AppendASCII(name); | 58 test_path = test_path.AppendASCII(name); |
| 58 test_path = test_path.Append(FILE_PATH_LITERAL("start.html")); | 59 test_path = test_path.Append(FILE_PATH_LITERAL("start.html")); |
| 60 ASSERT_TRUE(file_util::PathExists(test_path)) << "Missing test data"; |
| 59 test_url = net::FilePathToFileURL(test_path); | 61 test_url = net::FilePathToFileURL(test_path); |
| 60 } | 62 } |
| 61 | 63 |
| 62 // run N iterations | 64 // run N iterations |
| 63 GURL::Replacements replacements; | 65 GURL::Replacements replacements; |
| 64 const char query_string[] = "iterations=" TEST_ITERATIONS "&auto=1"; | 66 const char query_string[] = "iterations=" TEST_ITERATIONS "&auto=1"; |
| 65 replacements.SetQuery( | 67 replacements.SetQuery( |
| 66 query_string, | 68 query_string, |
| 67 url_parse::Component(0, arraysize(query_string) - 1)); | 69 url_parse::Component(0, arraysize(query_string) - 1)); |
| 68 test_url = test_url.ReplaceComponents(replacements); | 70 test_url = test_url.ReplaceComponents(replacements); |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 RunTest("bloat", true); | 353 RunTest("bloat", true); |
| 352 } | 354 } |
| 353 | 355 |
| 354 #if !defined(OS_MACOSX) | 356 #if !defined(OS_MACOSX) |
| 355 TEST_F(PageCyclerReferenceTest, BloatHttp) { | 357 TEST_F(PageCyclerReferenceTest, BloatHttp) { |
| 356 RunTest("bloat", true); | 358 RunTest("bloat", true); |
| 357 } | 359 } |
| 358 #endif | 360 #endif |
| 359 | 361 |
| 360 } // namespace | 362 } // namespace |
| OLD | NEW |