| 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 "sync/js/sync_js_controller.h" | 5 #include "sync/js/sync_js_controller.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "sync/js/js_event_details.h" | 9 #include "sync/js/js_event_details.h" |
| 10 #include "sync/js/js_test_util.h" | 10 #include "sync/js/js_test_util.h" |
| 11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace syncer { | 14 namespace syncer { |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 using ::testing::_; | 17 using ::testing::_; |
| 18 using ::testing::InSequence; | 18 using ::testing::InSequence; |
| 19 using ::testing::Mock; | 19 using ::testing::Mock; |
| 20 using ::testing::StrictMock; | 20 using ::testing::StrictMock; |
| 21 | 21 |
| 22 class SyncJsControllerTest : public testing::Test { | 22 class SyncJsControllerTest : public testing::Test { |
| 23 protected: | 23 protected: |
| 24 void PumpLoop() { | 24 void PumpLoop() { |
| 25 message_loop_.RunUntilIdle(); | 25 base::RunLoop().RunUntilIdle(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 private: | 28 private: |
| 29 base::MessageLoop message_loop_; | 29 base::MessageLoop message_loop_; |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 TEST_F(SyncJsControllerTest, Events) { | 32 TEST_F(SyncJsControllerTest, Events) { |
| 33 InSequence dummy; | 33 InSequence dummy; |
| 34 SyncJsController sync_js_controller; | 34 SyncJsController sync_js_controller; |
| 35 | 35 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 52 sync_js_controller.HandleJsEvent("anotherevent", details2); | 52 sync_js_controller.HandleJsEvent("anotherevent", details2); |
| 53 sync_js_controller.RemoveJsEventHandler(&event_handler1); | 53 sync_js_controller.RemoveJsEventHandler(&event_handler1); |
| 54 sync_js_controller.RemoveJsEventHandler(&event_handler2); | 54 sync_js_controller.RemoveJsEventHandler(&event_handler2); |
| 55 sync_js_controller.HandleJsEvent("droppedevent", details2); | 55 sync_js_controller.HandleJsEvent("droppedevent", details2); |
| 56 | 56 |
| 57 PumpLoop(); | 57 PumpLoop(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 } // namespace | 60 } // namespace |
| 61 } // namespace syncer | 61 } // namespace syncer |
| OLD | NEW |