| 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 // 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 time_now = base::Time::Now(); | 161 time_now = base::Time::Now(); |
| 162 test_log << "browser_launched_seconds="; | 162 test_log << "browser_launched_seconds="; |
| 163 test_log << (time_now.ToDoubleT() - time_start) << std::endl; | 163 test_log << (time_now.ToDoubleT() - time_start) << std::endl; |
| 164 | 164 |
| 165 bool is_timeout = false; | 165 bool is_timeout = false; |
| 166 int result = AUTOMATION_MSG_NAVIGATION_ERROR; | 166 int result = AUTOMATION_MSG_NAVIGATION_ERROR; |
| 167 // This is essentially what NavigateToURL does except we don't fire | 167 // This is essentially what NavigateToURL does except we don't fire |
| 168 // assertion when page loading fails. We log the result instead. | 168 // assertion when page loading fails. We log the result instead. |
| 169 { | 169 { |
| 170 // TabProxy should be released before Browser is closed. | 170 // TabProxy should be released before Browser is closed. |
| 171 scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); | 171 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 172 if (tab_proxy.get()) { | 172 if (tab_proxy.get()) { |
| 173 result = tab_proxy->NavigateToURLWithTimeout(url, timeout_ms, | 173 result = tab_proxy->NavigateToURLWithTimeout(url, timeout_ms, |
| 174 &is_timeout); | 174 &is_timeout); |
| 175 } | 175 } |
| 176 | 176 |
| 177 if (!is_timeout && result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { | 177 if (!is_timeout && result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { |
| 178 if (page_down) { | 178 if (page_down) { |
| 179 // Page down twice. | 179 // Page down twice. |
| 180 scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 180 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0))
; |
| 181 if (browser.get()) { | 181 if (browser.get()) { |
| 182 scoped_ptr<WindowProxy> window(browser->GetWindow()); | 182 scoped_refptr<WindowProxy> window(browser->GetWindow()); |
| 183 if (window.get()) { | 183 if (window.get()) { |
| 184 bool activation_timeout; | 184 bool activation_timeout; |
| 185 browser->BringToFrontWithTimeout(action_max_timeout_ms(), | 185 browser->BringToFrontWithTimeout(action_max_timeout_ms(), |
| 186 &activation_timeout); | 186 &activation_timeout); |
| 187 if (!activation_timeout) { | 187 if (!activation_timeout) { |
| 188 window->SimulateOSKeyPress(VK_NEXT, 0); | 188 window->SimulateOSKeyPress(VK_NEXT, 0); |
| 189 PlatformThread::Sleep(sleep_timeout_ms()); | 189 PlatformThread::Sleep(sleep_timeout_ms()); |
| 190 window->SimulateOSKeyPress(VK_NEXT, 0); | 190 window->SimulateOSKeyPress(VK_NEXT, 0); |
| 191 PlatformThread::Sleep(sleep_timeout_ms()); | 191 PlatformThread::Sleep(sleep_timeout_ms()); |
| 192 } | 192 } |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 EXPECT_EQ(1, metrics.browser_launch_count); | 365 EXPECT_EQ(1, metrics.browser_launch_count); |
| 366 EXPECT_EQ(0, metrics.browser_crash_count); | 366 EXPECT_EQ(0, metrics.browser_crash_count); |
| 367 EXPECT_EQ(0, metrics.renderer_crash_count); | 367 EXPECT_EQ(0, metrics.renderer_crash_count); |
| 368 EXPECT_EQ(0, metrics.plugin_crash_count); | 368 EXPECT_EQ(0, metrics.plugin_crash_count); |
| 369 | 369 |
| 370 // Verify metrics service does what we need when browser process crashes. | 370 // Verify metrics service does what we need when browser process crashes. |
| 371 HANDLE browser_process; | 371 HANDLE browser_process; |
| 372 LaunchBrowserAndServer(); | 372 LaunchBrowserAndServer(); |
| 373 { | 373 { |
| 374 // TabProxy should be released before Browser is closed. | 374 // TabProxy should be released before Browser is closed. |
| 375 scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); | 375 scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); |
| 376 if (tab_proxy.get()) { | 376 if (tab_proxy.get()) { |
| 377 tab_proxy->NavigateToURL(GURL(test_url_1)); | 377 tab_proxy->NavigateToURL(GURL(test_url_1)); |
| 378 } | 378 } |
| 379 } | 379 } |
| 380 // Kill browser process. | 380 // Kill browser process. |
| 381 browser_process = process(); | 381 browser_process = process(); |
| 382 TerminateProcess(browser_process, 0); | 382 TerminateProcess(browser_process, 0); |
| 383 | 383 |
| 384 GetStabilityMetrics(&metrics); | 384 GetStabilityMetrics(&metrics); |
| 385 // This is not a clean shutdown. | 385 // This is not a clean shutdown. |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { | 700 if (v8_command_line.HasSwitch(kV8LogFileSwitch)) { |
| 701 v8_log_path = v8_command_line.GetSwitchValue(kV8LogFileSwitch); | 701 v8_log_path = v8_command_line.GetSwitchValue(kV8LogFileSwitch); |
| 702 if (!file_util::AbsolutePath(&v8_log_path)) { | 702 if (!file_util::AbsolutePath(&v8_log_path)) { |
| 703 v8_log_path.clear(); | 703 v8_log_path.clear(); |
| 704 } | 704 } |
| 705 } | 705 } |
| 706 } | 706 } |
| 707 } | 707 } |
| 708 } | 708 } |
| 709 } | 709 } |
| OLD | NEW |