Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(531)

Side by Side Diff: blimp/client/feature/navigation_feature_unittest.cc

Issue 1929723002: [Blimp] Adds blimp engine browser test framework and LoadUrl test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « blimp/client/feature/navigation_feature.h ('k') | blimp/client/feature/render_widget_feature.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 7 #include <memory>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "blimp/client/feature/mock_navigation_feature_delegate.h"
11 #include "blimp/common/create_blimp_message.h" 12 #include "blimp/common/create_blimp_message.h"
12 #include "blimp/common/proto/blimp_message.pb.h" 13 #include "blimp/common/proto/blimp_message.pb.h"
13 #include "blimp/net/test_common.h" 14 #include "blimp/net/test_common.h"
14 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
15 #include "net/base/test_completion_callback.h" 16 #include "net/base/test_completion_callback.h"
16 #include "testing/gmock/include/gmock/gmock.h" 17 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 18 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
19 #include "url/gurl.h" 20 #include "url/gurl.h"
20 21
21 using testing::_; 22 using testing::_;
22 23
23 namespace blimp { 24 namespace blimp {
24 namespace client { 25 namespace client {
25 26
26 class MockNavigationFeatureDelegate
27 : public NavigationFeature::NavigationFeatureDelegate {
28 public:
29 // NavigationFeatureDelegate implementation.
30 MOCK_METHOD2(OnUrlChanged, void(int tab_id, const GURL& url));
31 MOCK_METHOD2(OnFaviconChanged, void(int tab_id, const SkBitmap& favicon));
32 MOCK_METHOD2(OnTitleChanged, void(int tab_id, const std::string& title));
33 MOCK_METHOD2(OnLoadingChanged, void(int tab_id, bool loading));
34 MOCK_METHOD2(OnPageLoadStatusUpdate, void(int tab_id, bool completed));
35 };
36
37 void SendMockNavigationStateChangedMessage(BlimpMessageProcessor* processor, 27 void SendMockNavigationStateChangedMessage(BlimpMessageProcessor* processor,
38 int tab_id, 28 int tab_id,
39 const GURL* url, 29 const GURL* url,
40 const std::string* title, 30 const std::string* title,
41 const bool* loading) { 31 const bool* loading) {
42 NavigationMessage* navigation_message; 32 NavigationMessage* navigation_message;
43 std::unique_ptr<BlimpMessage> message = 33 std::unique_ptr<BlimpMessage> message =
44 CreateBlimpMessage(&navigation_message, tab_id); 34 CreateBlimpMessage(&navigation_message, tab_id);
45 navigation_message->set_type(NavigationMessage::NAVIGATION_STATE_CHANGED); 35 navigation_message->set_type(NavigationMessage::NAVIGATION_STATE_CHANGED);
46 NavigationStateChangeMessage* state = 36 NavigationStateChangeMessage* state =
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 147
158 TEST_F(NavigationFeatureTest, TestNavigateReloadMessage) { 148 TEST_F(NavigationFeatureTest, TestNavigateReloadMessage) {
159 EXPECT_CALL(*out_processor_, 149 EXPECT_CALL(*out_processor_,
160 MockableProcessMessage(EqualsNavigateReload(1), _)) 150 MockableProcessMessage(EqualsNavigateReload(1), _))
161 .Times(1); 151 .Times(1);
162 feature_.Reload(1); 152 feature_.Reload(1);
163 } 153 }
164 154
165 } // namespace client 155 } // namespace client
166 } // namespace blimp 156 } // namespace blimp
OLDNEW
« no previous file with comments | « blimp/client/feature/navigation_feature.h ('k') | blimp/client/feature/render_widget_feature.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698