| 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 #include "chrome/test/ui_test_utils.h" | 5 #include "chrome/test/ui_test_utils.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 views::AcceleratorHandler handler; | 388 views::AcceleratorHandler handler; |
| 389 loop->Run(&handler); | 389 loop->Run(&handler); |
| 390 #elif defined(OS_LINUX) | 390 #elif defined(OS_LINUX) |
| 391 loop->Run(NULL); | 391 loop->Run(NULL); |
| 392 #else | 392 #else |
| 393 loop->Run(); | 393 loop->Run(); |
| 394 #endif | 394 #endif |
| 395 loop->SetNestableTasksAllowed(did_allow_task_nesting); | 395 loop->SetNestableTasksAllowed(did_allow_task_nesting); |
| 396 } | 396 } |
| 397 | 397 |
| 398 void RunAllPendingInMessageLoop() { |
| 399 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); |
| 400 ui_test_utils::RunMessageLoop(); |
| 401 } |
| 402 |
| 398 bool GetCurrentTabTitle(const Browser* browser, string16* title) { | 403 bool GetCurrentTabTitle(const Browser* browser, string16* title) { |
| 399 TabContents* tab_contents = browser->GetSelectedTabContents(); | 404 TabContents* tab_contents = browser->GetSelectedTabContents(); |
| 400 if (!tab_contents) | 405 if (!tab_contents) |
| 401 return false; | 406 return false; |
| 402 NavigationEntry* last_entry = tab_contents->controller().GetActiveEntry(); | 407 NavigationEntry* last_entry = tab_contents->controller().GetActiveEntry(); |
| 403 if (!last_entry) | 408 if (!last_entry) |
| 404 return false; | 409 return false; |
| 405 title->assign(last_entry->title()); | 410 title->assign(last_entry->title()); |
| 406 return true; | 411 return true; |
| 407 } | 412 } |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 | 737 |
| 733 TestWebSocketServer::~TestWebSocketServer() { | 738 TestWebSocketServer::~TestWebSocketServer() { |
| 734 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); | 739 scoped_ptr<CommandLine> cmd_line(CreateWebSocketServerCommandLine()); |
| 735 cmd_line->AppendSwitchWithValue("server", "stop"); | 740 cmd_line->AppendSwitchWithValue("server", "stop"); |
| 736 cmd_line->AppendSwitchWithValue("pidfile", | 741 cmd_line->AppendSwitchWithValue("pidfile", |
| 737 websocket_pid_file_.ToWStringHack()); | 742 websocket_pid_file_.ToWStringHack()); |
| 738 base::LaunchApp(*cmd_line.get(), true, false, NULL); | 743 base::LaunchApp(*cmd_line.get(), true, false, NULL); |
| 739 } | 744 } |
| 740 | 745 |
| 741 } // namespace ui_test_utils | 746 } // namespace ui_test_utils |
| OLD | NEW |