| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
| 8 #include "chrome/browser/extensions/extension_browsertest.h" | 8 #include "chrome/browser/extensions/extension_browsertest.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/test_utils.h" | 10 #include "content/public/test/test_utils.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 class KeyEventDoneCallback { | 113 class KeyEventDoneCallback { |
| 114 public: | 114 public: |
| 115 explicit KeyEventDoneCallback(bool expected_argument) | 115 explicit KeyEventDoneCallback(bool expected_argument) |
| 116 : expected_argument_(expected_argument), | 116 : expected_argument_(expected_argument), |
| 117 is_called_(false) {} | 117 is_called_(false) {} |
| 118 ~KeyEventDoneCallback() {} | 118 ~KeyEventDoneCallback() {} |
| 119 | 119 |
| 120 void Run(bool consumed) { | 120 void Run(bool consumed) { |
| 121 if (consumed == expected_argument_) { | 121 if (consumed == expected_argument_) { |
| 122 base::MessageLoop::current()->Quit(); | 122 base::MessageLoop::current()->QuitWhenIdle(); |
| 123 is_called_ = true; | 123 is_called_ = true; |
| 124 } | 124 } |
| 125 } | 125 } |
| 126 | 126 |
| 127 void WaitUntilCalled() { | 127 void WaitUntilCalled() { |
| 128 while (!is_called_) | 128 while (!is_called_) |
| 129 content::RunMessageLoop(); | 129 content::RunMessageLoop(); |
| 130 } | 130 } |
| 131 | 131 |
| 132 private: | 132 private: |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 EXPECT_EQ("", mock_input_context->last_commit_text()); | 1040 EXPECT_EQ("", mock_input_context->last_commit_text()); |
| 1041 } | 1041 } |
| 1042 | 1042 |
| 1043 IMEBridge::Get()->SetInputContextHandler(NULL); | 1043 IMEBridge::Get()->SetInputContextHandler(NULL); |
| 1044 IMEBridge::Get()->SetCandidateWindowHandler(NULL); | 1044 IMEBridge::Get()->SetCandidateWindowHandler(NULL); |
| 1045 } | 1045 } |
| 1046 | 1046 |
| 1047 } // namespace | 1047 } // namespace |
| 1048 } // namespace input_method | 1048 } // namespace input_method |
| 1049 } // namespace chromeos | 1049 } // namespace chromeos |
| OLD | NEW |