OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file provides reliablity test which runs under UI test framework. The | 5 // This file provides reliablity test which runs under UI test framework. The |
6 // test is intended to run within QEMU environment. | 6 // test is intended to run within QEMU environment. |
7 // | 7 // |
8 // Usage 1: reliability_test | 8 // Usage 1: reliability_test |
9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly | 9 // Upon invocation, it visits a hard coded list of sample URLs. This is mainly |
10 // used by buildbot, to verify reliability_test itself runs ok. | 10 // used by buildbot, to verify reliability_test itself runs ok. |
(...skipping 19 matching lines...) Expand all Loading... |
30 // --logfile=filepath: saves the visit log to the specified path. | 30 // --logfile=filepath: saves the visit log to the specified path. |
31 // --timeout=millisecond: time out as specified in millisecond during each | 31 // --timeout=millisecond: time out as specified in millisecond during each |
32 // page load. | 32 // page load. |
33 // --nopagedown: won't simulate page down key presses after page load. | 33 // --nopagedown: won't simulate page down key presses after page load. |
34 // --noclearprofile: do not clear profile dir before firing up each time. | 34 // --noclearprofile: do not clear profile dir before firing up each time. |
35 // --savedebuglog: save Chrome, V8, and test debug log for each page loaded. | 35 // --savedebuglog: save Chrome, V8, and test debug log for each page loaded. |
36 | 36 |
37 #include <fstream> | 37 #include <fstream> |
38 #include <vector> | 38 #include <vector> |
39 | 39 |
40 #include "app/keyboard_codes.h" | |
41 #include "base/command_line.h" | 40 #include "base/command_line.h" |
42 #include "base/file_path.h" | 41 #include "base/file_path.h" |
43 #include "base/file_util.h" | 42 #include "base/file_util.h" |
44 #include "base/file_version_info.h" | 43 #include "base/file_version_info.h" |
45 #include "base/i18n/time_formatting.h" | 44 #include "base/i18n/time_formatting.h" |
46 #include "base/path_service.h" | 45 #include "base/path_service.h" |
47 #include "base/string_number_conversions.h" | 46 #include "base/string_number_conversions.h" |
48 #include "base/string_util.h" | 47 #include "base/string_util.h" |
49 #include "base/test/test_file_util.h" | 48 #include "base/test/test_file_util.h" |
50 #include "base/threading/platform_thread.h" | 49 #include "base/threading/platform_thread.h" |
(...skipping 11 matching lines...) Expand all Loading... |
62 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
63 #include "chrome/common/render_messages.h" | 62 #include "chrome/common/render_messages.h" |
64 #include "chrome/common/url_constants.h" | 63 #include "chrome/common/url_constants.h" |
65 #include "chrome/test/automation/automation_proxy.h" | 64 #include "chrome/test/automation/automation_proxy.h" |
66 #include "chrome/test/automation/browser_proxy.h" | 65 #include "chrome/test/automation/browser_proxy.h" |
67 #include "chrome/test/automation/tab_proxy.h" | 66 #include "chrome/test/automation/tab_proxy.h" |
68 #include "chrome/test/automation/window_proxy.h" | 67 #include "chrome/test/automation/window_proxy.h" |
69 #include "chrome/test/reliability/page_load_test.h" | 68 #include "chrome/test/reliability/page_load_test.h" |
70 #include "chrome/test/ui/ui_test.h" | 69 #include "chrome/test/ui/ui_test.h" |
71 #include "net/base/net_util.h" | 70 #include "net/base/net_util.h" |
| 71 #include "ui/base/keycodes/keyboard_codes.h" |
72 #include "v8/include/v8-testing.h" | 72 #include "v8/include/v8-testing.h" |
73 | 73 |
74 namespace { | 74 namespace { |
75 | 75 |
76 // See comments at the beginning of the file for the definition of switches. | 76 // See comments at the beginning of the file for the definition of switches. |
77 const char kSiteSwitch[] = "site"; | 77 const char kSiteSwitch[] = "site"; |
78 const char kStartPageSwitch[] = "startpage"; | 78 const char kStartPageSwitch[] = "startpage"; |
79 const char kEndPageSwitch[] = "endpage"; | 79 const char kEndPageSwitch[] = "endpage"; |
80 const char kListSwitch[] = "list"; | 80 const char kListSwitch[] = "list"; |
81 const char kStartIndexSwitch[] = "startline"; | 81 const char kStartIndexSwitch[] = "startline"; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 // Page down twice. | 226 // Page down twice. |
227 scoped_refptr<BrowserProxy> browser( | 227 scoped_refptr<BrowserProxy> browser( |
228 automation()->GetBrowserWindow(0)); | 228 automation()->GetBrowserWindow(0)); |
229 if (browser.get()) { | 229 if (browser.get()) { |
230 scoped_refptr<WindowProxy> window(browser->GetWindow()); | 230 scoped_refptr<WindowProxy> window(browser->GetWindow()); |
231 if (window.get()) { | 231 if (window.get()) { |
232 if (browser->BringToFront()) { | 232 if (browser->BringToFront()) { |
233 // Sleep for 2 seconds between commands. | 233 // Sleep for 2 seconds between commands. |
234 // This used to be settable but the flag went away. | 234 // This used to be settable but the flag went away. |
235 int sleep_time_ms = 2000; | 235 int sleep_time_ms = 2000; |
236 window->SimulateOSKeyPress(app::VKEY_NEXT, 0); | 236 window->SimulateOSKeyPress(ui::VKEY_NEXT, 0); |
237 base::PlatformThread::Sleep(sleep_time_ms); | 237 base::PlatformThread::Sleep(sleep_time_ms); |
238 window->SimulateOSKeyPress(app::VKEY_NEXT, 0); | 238 window->SimulateOSKeyPress(ui::VKEY_NEXT, 0); |
239 base::PlatformThread::Sleep(sleep_time_ms); | 239 base::PlatformThread::Sleep(sleep_time_ms); |
240 } | 240 } |
241 } | 241 } |
242 } | 242 } |
243 } | 243 } |
244 } | 244 } |
245 } | 245 } |
246 | 246 |
247 // Log navigate complete time. | 247 // Log navigate complete time. |
248 time_now = base::Time::Now(); | 248 time_now = base::Time::Now(); |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
812 } | 812 } |
813 } | 813 } |
814 | 814 |
815 if (parsed_command_line.HasSwitch(kStressOptSwitch)) { | 815 if (parsed_command_line.HasSwitch(kStressOptSwitch)) { |
816 g_stress_opt = true; | 816 g_stress_opt = true; |
817 } | 817 } |
818 if (parsed_command_line.HasSwitch(kStressDeoptSwitch)) { | 818 if (parsed_command_line.HasSwitch(kStressDeoptSwitch)) { |
819 g_stress_deopt = true; | 819 g_stress_deopt = true; |
820 } | 820 } |
821 } | 821 } |
OLD | NEW |