OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 return_value = return_value && | 655 return_value = return_value && |
656 DoAction(kTestDialogPossibleActions[action_index]); | 656 DoAction(kTestDialogPossibleActions[action_index]); |
657 if (DidCrash(false)) | 657 if (DidCrash(false)) |
658 break; | 658 break; |
659 } | 659 } |
660 return DoAction("PressEscapeKey") && return_value; | 660 return DoAction("PressEscapeKey") && return_value; |
661 } | 661 } |
662 | 662 |
663 bool AutomatedUITest::ForceCrash() { | 663 bool AutomatedUITest::ForceCrash() { |
664 scoped_refptr<TabProxy> tab(GetActiveTab()); | 664 scoped_refptr<TabProxy> tab(GetActiveTab()); |
665 GURL test_url(chrome::kChromeUICrashURL); | 665 GURL test_url(content::kChromeUICrashURL); |
666 AutomationMsg_NavigationResponseValues result = tab->NavigateToURL(test_url); | 666 AutomationMsg_NavigationResponseValues result = tab->NavigateToURL(test_url); |
667 if (result != AUTOMATION_MSG_NAVIGATION_SUCCESS) { | 667 if (result != AUTOMATION_MSG_NAVIGATION_SUCCESS) { |
668 AddErrorAttribute("navigation_failed"); | 668 AddErrorAttribute("navigation_failed"); |
669 return false; | 669 return false; |
670 } | 670 } |
671 return true; | 671 return true; |
672 } | 672 } |
673 | 673 |
674 bool AutomatedUITest::SimulateKeyPress(ui::KeyboardCode key) { | 674 bool AutomatedUITest::SimulateKeyPress(ui::KeyboardCode key) { |
675 scoped_refptr<TabProxy> tab(GetActiveTab()); | 675 scoped_refptr<TabProxy> tab(GetActiveTab()); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 } | 809 } |
810 } | 810 } |
811 | 811 |
812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 812 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 813 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
814 if (parsed_command_line.HasSwitch(kReproSwitch)) | 814 if (parsed_command_line.HasSwitch(kReproSwitch)) |
815 RunReproduction(); | 815 RunReproduction(); |
816 else | 816 else |
817 RunAutomatedUITest(); | 817 RunAutomatedUITest(); |
818 } | 818 } |
OLD | NEW |