| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/message_loop/message_loop.h" | 5 #include "base/message_loop/message_loop.h" |
| 6 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h" | 6 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h" |
| 7 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h" | 7 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h" |
| 8 #include "blimp/client/core/contents/fake_navigation_feature.h" | 8 #include "blimp/client/core/contents/fake_navigation_feature.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 base::MessageLoop loop; | 33 base::MessageLoop loop; |
| 34 | 34 |
| 35 testing::StrictMock<MockBlimpNavigationControllerDelegate> delegate; | 35 testing::StrictMock<MockBlimpNavigationControllerDelegate> delegate; |
| 36 testing::StrictMock<FakeNavigationFeature> feature; | 36 testing::StrictMock<FakeNavigationFeature> feature; |
| 37 BlimpNavigationControllerImpl navigation_controller(&delegate, &feature); | 37 BlimpNavigationControllerImpl navigation_controller(&delegate, &feature); |
| 38 feature.SetDelegate(1, &navigation_controller); | 38 feature.SetDelegate(1, &navigation_controller); |
| 39 | 39 |
| 40 EXPECT_CALL(delegate, OnNavigationStateChanged()); | 40 EXPECT_CALL(delegate, OnNavigationStateChanged()); |
| 41 | 41 |
| 42 navigation_controller.LoadURL(kExampleURL); | 42 navigation_controller.LoadURL(kExampleURL); |
| 43 loop.RunUntilIdle(); |
| 43 EXPECT_EQ(kExampleURL, navigation_controller.GetURL()); | 44 EXPECT_EQ(kExampleURL, navigation_controller.GetURL()); |
| 44 | 45 |
| 45 EXPECT_CALL(feature, GoBack(_)); | 46 EXPECT_CALL(feature, GoBack(_)); |
| 46 EXPECT_CALL(feature, GoForward(_)); | 47 EXPECT_CALL(feature, GoForward(_)); |
| 47 EXPECT_CALL(feature, Reload(_)); | 48 EXPECT_CALL(feature, Reload(_)); |
| 48 | 49 |
| 49 navigation_controller.GoBack(); | 50 navigation_controller.GoBack(); |
| 50 navigation_controller.GoForward(); | 51 navigation_controller.GoForward(); |
| 51 navigation_controller.Reload(); | 52 navigation_controller.Reload(); |
| 52 | 53 |
| 53 loop.RunUntilIdle(); | 54 loop.RunUntilIdle(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 } // namespace | 57 } // namespace |
| 57 } // namespace client | 58 } // namespace client |
| 58 } // namespace blimp | 59 } // namespace blimp |
| OLD | NEW |