| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (!finished_) { | 101 if (!finished_) { |
| 102 waiting_ = true; | 102 waiting_ = true; |
| 103 content::RunMessageLoop(); | 103 content::RunMessageLoop(); |
| 104 waiting_ = false; | 104 waiting_ = false; |
| 105 } | 105 } |
| 106 return finished_; | 106 return finished_; |
| 107 } | 107 } |
| 108 | 108 |
| 109 virtual void Observe(int type, | 109 virtual void Observe(int type, |
| 110 const content::NotificationSource& source, | 110 const content::NotificationSource& source, |
| 111 const content::NotificationDetails& details) { | 111 const content::NotificationDetails& details) OVERRIDE { |
| 112 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); | 112 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); |
| 113 content::Details<DomOperationNotificationDetails> dom_op_details(details); | 113 content::Details<DomOperationNotificationDetails> dom_op_details(details); |
| 114 // We might receive responses for other script execution, but we only | 114 // We might receive responses for other script execution, but we only |
| 115 // care about the test finished message. | 115 // care about the test finished message. |
| 116 if (dom_op_details->json == "\"FINISHED\"") { | 116 if (dom_op_details->json == "\"FINISHED\"") { |
| 117 finished_ = true; | 117 finished_ = true; |
| 118 if (waiting_) | 118 if (waiting_) |
| 119 MessageLoopForUI::current()->Quit(); | 119 MessageLoopForUI::current()->Quit(); |
| 120 } | 120 } |
| 121 } | 121 } |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); | 886 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); |
| 887 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 887 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
| 888 | 888 |
| 889 // Ctrl+Alt should have no effect. | 889 // Ctrl+Alt should have no effect. |
| 890 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); | 890 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); |
| 891 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 891 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
| 892 } | 892 } |
| 893 #endif | 893 #endif |
| 894 | 894 |
| 895 } // namespace | 895 } // namespace |
| OLD | NEW |