| 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 <fstream> | 5 #include <fstream> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/keyboard_codes.h" | 9 #include "base/keyboard_codes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 if (DidCrash(false)) | 616 if (DidCrash(false)) |
| 617 break; | 617 break; |
| 618 } | 618 } |
| 619 return DoAction("PressEscapeKey") && return_value; | 619 return DoAction("PressEscapeKey") && return_value; |
| 620 } | 620 } |
| 621 | 621 |
| 622 bool AutomatedUITest::ForceCrash() { | 622 bool AutomatedUITest::ForceCrash() { |
| 623 scoped_refptr<TabProxy> tab(GetActiveTab()); | 623 scoped_refptr<TabProxy> tab(GetActiveTab()); |
| 624 GURL test_url("about:crash"); | 624 GURL test_url("about:crash"); |
| 625 bool did_timeout; | 625 bool did_timeout; |
| 626 tab->NavigateToURLWithTimeout(test_url, kDebuggingTimeoutMsec, &did_timeout); | 626 tab->NavigateToURLWithTimeout(test_url, 1, kDebuggingTimeoutMsec, |
| 627 &did_timeout); |
| 627 if (!did_timeout) { | 628 if (!did_timeout) { |
| 628 AddInfoAttribute("expected_crash"); | 629 AddInfoAttribute("expected_crash"); |
| 629 return false; | 630 return false; |
| 630 } | 631 } |
| 631 return true; | 632 return true; |
| 632 } | 633 } |
| 633 | 634 |
| 634 bool AutomatedUITest::SimulateKeyPressInActiveWindow(wchar_t key, int flags) { | 635 bool AutomatedUITest::SimulateKeyPressInActiveWindow(wchar_t key, int flags) { |
| 635 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); | 636 scoped_refptr<WindowProxy> window(automation()->GetActiveWindow()); |
| 636 if (window.get() == NULL) { | 637 if (window.get() == NULL) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 } | 785 } |
| 785 } | 786 } |
| 786 | 787 |
| 787 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 788 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
| 788 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 789 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
| 789 if (parsed_command_line.HasSwitch(kReproSwitch)) | 790 if (parsed_command_line.HasSwitch(kReproSwitch)) |
| 790 RunReproduction(); | 791 RunReproduction(); |
| 791 else | 792 else |
| 792 RunAutomatedUITest(); | 793 RunAutomatedUITest(); |
| 793 } | 794 } |
| OLD | NEW |