| 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 "chrome/test/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 AppModalDialog* Wait() { | 118 AppModalDialog* Wait() { |
| 119 if (dialog_) | 119 if (dialog_) |
| 120 return dialog_; | 120 return dialog_; |
| 121 message_loop_runner_ = new content::MessageLoopRunner; | 121 message_loop_runner_ = new content::MessageLoopRunner; |
| 122 message_loop_runner_->Run(); | 122 message_loop_runner_->Run(); |
| 123 EXPECT_TRUE(dialog_); | 123 EXPECT_TRUE(dialog_); |
| 124 return dialog_; | 124 return dialog_; |
| 125 } | 125 } |
| 126 | 126 |
| 127 // AppModalDialogWaiter: | 127 // AppModalDialogWaiter: |
| 128 virtual void Notify(AppModalDialog* dialog) override { | 128 void Notify(AppModalDialog* dialog) override { |
| 129 DCHECK(!dialog_); | 129 DCHECK(!dialog_); |
| 130 dialog_ = dialog; | 130 dialog_ = dialog; |
| 131 if (message_loop_runner_.get() && message_loop_runner_->loop_running()) | 131 if (message_loop_runner_.get() && message_loop_runner_->loop_running()) |
| 132 message_loop_runner_->Quit(); | 132 message_loop_runner_->Quit(); |
| 133 } | 133 } |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 AppModalDialog* dialog_; | 136 AppModalDialog* dialog_; |
| 137 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; | 137 scoped_refptr<content::MessageLoopRunner> message_loop_runner_; |
| 138 | 138 |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 | 534 |
| 535 void HistoryEnumerator::HistoryQueryComplete( | 535 void HistoryEnumerator::HistoryQueryComplete( |
| 536 const base::Closure& quit_task, | 536 const base::Closure& quit_task, |
| 537 history::QueryResults* results) { | 537 history::QueryResults* results) { |
| 538 for (size_t i = 0; i < results->size(); ++i) | 538 for (size_t i = 0; i < results->size(); ++i) |
| 539 urls_.push_back((*results)[i].url()); | 539 urls_.push_back((*results)[i].url()); |
| 540 quit_task.Run(); | 540 quit_task.Run(); |
| 541 } | 541 } |
| 542 | 542 |
| 543 } // namespace ui_test_utils | 543 } // namespace ui_test_utils |
| OLD | NEW |