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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 void Observe(int type, | 110 void Observe(int type, |
111 const content::NotificationSource& source, | 111 const content::NotificationSource& source, |
112 const content::NotificationDetails& details) override { | 112 const content::NotificationDetails& details) override { |
113 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); | 113 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); |
114 content::Details<std::string> dom_op_result(details); | 114 content::Details<std::string> dom_op_result(details); |
115 // We might receive responses for other script execution, but we only | 115 // We might receive responses for other script execution, but we only |
116 // care about the test finished message. | 116 // care about the test finished message. |
117 if (*dom_op_result.ptr() == "\"FINISHED\"") { | 117 if (*dom_op_result.ptr() == "\"FINISHED\"") { |
118 finished_ = true; | 118 finished_ = true; |
119 if (waiting_) | 119 if (waiting_) |
120 base::MessageLoopForUI::current()->Quit(); | 120 base::MessageLoopForUI::current()->QuitWhenIdle(); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 private: | 124 private: |
125 bool finished_; | 125 bool finished_; |
126 bool waiting_; | 126 bool waiting_; |
127 content::NotificationRegistrar registrar_; | 127 content::NotificationRegistrar registrar_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); | 129 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); |
130 }; | 130 }; |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
863 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); | 863 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestAltKeySuppress)); |
864 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 864 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
865 | 865 |
866 // Ctrl+Alt should have no effect. | 866 // Ctrl+Alt should have no effect. |
867 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); | 867 EXPECT_NO_FATAL_FAILURE(TestKeyEvent(tab_index, kTestCtrlAltKey)); |
868 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); | 868 ASSERT_TRUE(IsViewFocused(VIEW_ID_TAB_CONTAINER)); |
869 } | 869 } |
870 #endif | 870 #endif |
871 | 871 |
872 } // namespace | 872 } // namespace |
OLD | NEW |