| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/feature/navigation_feature.h" | 5 #include "blimp/client/feature/navigation_feature.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "blimp/common/create_blimp_message.h" | 9 #include "blimp/common/create_blimp_message.h" |
| 10 #include "blimp/common/proto/blimp_message.pb.h" | 10 #include "blimp/common/proto/blimp_message.pb.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 bool loading = true; | 125 bool loading = true; |
| 126 | 126 |
| 127 EXPECT_CALL(delegate1_, OnUrlChanged(_, _)).Times(0); | 127 EXPECT_CALL(delegate1_, OnUrlChanged(_, _)).Times(0); |
| 128 EXPECT_CALL(delegate1_, OnTitleChanged(1, title)).Times(1); | 128 EXPECT_CALL(delegate1_, OnTitleChanged(1, title)).Times(1); |
| 129 EXPECT_CALL(delegate1_, OnLoadingChanged(1, loading)).Times(1); | 129 EXPECT_CALL(delegate1_, OnLoadingChanged(1, loading)).Times(1); |
| 130 SendMockNavigationStateChangedMessage(&feature_, 1, nullptr, &title, | 130 SendMockNavigationStateChangedMessage(&feature_, 1, nullptr, &title, |
| 131 &loading); | 131 &loading); |
| 132 } | 132 } |
| 133 | 133 |
| 134 TEST_F(NavigationFeatureTest, TestNavigateToUrlMessage) { | 134 TEST_F(NavigationFeatureTest, TestNavigateToUrlMessage) { |
| 135 std::string text = "text"; | 135 std::string text = "http://google.com/"; |
| 136 | 136 |
| 137 EXPECT_CALL(*out_processor_, | 137 EXPECT_CALL(*out_processor_, |
| 138 MockableProcessMessage(EqualsNavigateToUrlText(1, text), _)) | 138 MockableProcessMessage(EqualsNavigateToUrlText(1, text), _)) |
| 139 .Times(1); | 139 .Times(1); |
| 140 feature_.NavigateToUrlText(1, text); | 140 feature_.NavigateToUrlText(1, text); |
| 141 } | 141 } |
| 142 | 142 |
| 143 TEST_F(NavigationFeatureTest, TestNavigateForwardMessage) { | 143 TEST_F(NavigationFeatureTest, TestNavigateForwardMessage) { |
| 144 EXPECT_CALL(*out_processor_, | 144 EXPECT_CALL(*out_processor_, |
| 145 MockableProcessMessage(EqualsNavigateForward(1), _)) | 145 MockableProcessMessage(EqualsNavigateForward(1), _)) |
| 146 .Times(1); | 146 .Times(1); |
| 147 feature_.GoForward(1); | 147 feature_.GoForward(1); |
| 148 } | 148 } |
| 149 | 149 |
| 150 TEST_F(NavigationFeatureTest, TestNavigateBackMessage) { | 150 TEST_F(NavigationFeatureTest, TestNavigateBackMessage) { |
| 151 EXPECT_CALL(*out_processor_, MockableProcessMessage(EqualsNavigateBack(1), _)) | 151 EXPECT_CALL(*out_processor_, MockableProcessMessage(EqualsNavigateBack(1), _)) |
| 152 .Times(1); | 152 .Times(1); |
| 153 feature_.GoBack(1); | 153 feature_.GoBack(1); |
| 154 } | 154 } |
| 155 | 155 |
| 156 TEST_F(NavigationFeatureTest, TestNavigateReloadMessage) { | 156 TEST_F(NavigationFeatureTest, TestNavigateReloadMessage) { |
| 157 EXPECT_CALL(*out_processor_, | 157 EXPECT_CALL(*out_processor_, |
| 158 MockableProcessMessage(EqualsNavigateReload(1), _)) | 158 MockableProcessMessage(EqualsNavigateReload(1), _)) |
| 159 .Times(1); | 159 .Times(1); |
| 160 feature_.Reload(1); | 160 feature_.Reload(1); |
| 161 } | 161 } |
| 162 | 162 |
| 163 } // namespace client | 163 } // namespace client |
| 164 } // namespace blimp | 164 } // namespace blimp |
| OLD | NEW |