OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 AddInfoAttribute("no_new_browser_window"); | 829 AddInfoAttribute("no_new_browser_window"); |
830 return false; | 830 return false; |
831 } | 831 } |
832 } | 832 } |
833 return true; | 833 return true; |
834 } | 834 } |
835 | 835 |
836 WindowProxy* AutomatedUITest::GetAndActivateWindowForBrowser( | 836 WindowProxy* AutomatedUITest::GetAndActivateWindowForBrowser( |
837 BrowserProxy* browser) { | 837 BrowserProxy* browser) { |
838 bool did_timeout; | 838 bool did_timeout; |
839 if (!browser->BringToFrontWithTimeout(action_max_timeout_ms(), &did_timeout))
{ | 839 if (!browser->BringToFrontWithTimeout(action_max_timeout_ms(), |
| 840 &did_timeout)) { |
840 AddWarningAttribute("failed_to_bring_window_to_front"); | 841 AddWarningAttribute("failed_to_bring_window_to_front"); |
841 return NULL; | 842 return NULL; |
842 } | 843 } |
843 | 844 |
844 WindowProxy* window = browser->GetWindow(); | 845 WindowProxy* window = browser->GetWindow(); |
845 return window; | 846 return window; |
846 } | 847 } |
847 | 848 |
848 bool AutomatedUITest::RunCommand(int browser_command) { | 849 bool AutomatedUITest::RunCommand(int browser_command) { |
849 scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow()); | 850 scoped_ptr<BrowserProxy> browser(automation()->GetLastActiveBrowserWindow()); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 } | 1011 } |
1011 } | 1012 } |
1012 | 1013 |
1013 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { | 1014 TEST_F(AutomatedUITest, TheOneAndOnlyTest) { |
1014 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 1015 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
1015 if (parsed_command_line.HasSwitch(kReproSwitch)) | 1016 if (parsed_command_line.HasSwitch(kReproSwitch)) |
1016 RunReproduction(); | 1017 RunReproduction(); |
1017 else | 1018 else |
1018 RunAutomatedUITest(); | 1019 RunAutomatedUITest(); |
1019 } | 1020 } |
OLD | NEW |