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

Side by Side Diff: ios/web/webui/web_ui_mojo_inttest.mm

Issue 2720613005: Refactor serialisation of openerId & openerNavigationIndex. (Closed)
Patch Set: Fix CRWSessionController's initializer comment. Created 3 years, 9 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 | « ios/web/web_state/web_state_impl_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <memory> 5 #include <memory>
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #import "base/test/ios/wait_util.h" 9 #import "base/test/ios/wait_util.h"
10 #import "ios/web/public/navigation_manager.h" 10 #import "ios/web/public/navigation_manager.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 TestUIHandler* ui_handler_; 127 TestUIHandler* ui_handler_;
128 }; 128 };
129 } // namespace 129 } // namespace
130 130
131 // A test fixture for verifying mojo comminication for WebUI. 131 // A test fixture for verifying mojo comminication for WebUI.
132 class WebUIMojoTest : public WebIntTest { 132 class WebUIMojoTest : public WebIntTest {
133 protected: 133 protected:
134 WebUIMojoTest() 134 WebUIMojoTest()
135 : web_state_(new WebStateImpl(GetBrowserState())), 135 : web_state_(new WebStateImpl(GetBrowserState())),
136 ui_handler_(new TestUIHandler()) { 136 ui_handler_(new TestUIHandler()) {
137 web_state_->GetNavigationManagerImpl().InitializeSession(nil, nil, NO, 0); 137 web_state_->GetNavigationManagerImpl().InitializeSession(nil, NO);
138 WebUIIOSControllerFactory::RegisterFactory( 138 WebUIIOSControllerFactory::RegisterFactory(
139 new TestWebUIControllerFactory(ui_handler_.get())); 139 new TestWebUIControllerFactory(ui_handler_.get()));
140 } 140 }
141 141
142 // Returns WebState which loads test WebUI page. 142 // Returns WebState which loads test WebUI page.
143 WebStateImpl* web_state() { return web_state_.get(); } 143 WebStateImpl* web_state() { return web_state_.get(); }
144 // Returns UI handler which communicates with WebUI page. 144 // Returns UI handler which communicates with WebUI page.
145 TestUIHandler* test_ui_handler() { return ui_handler_.get(); } 145 TestUIHandler* test_ui_handler() { return ui_handler_.get(); }
146 146
147 private: 147 private:
(...skipping 12 matching lines...) Expand all
160 web_state()->GetNavigationManager()->LoadURLWithParams(load_params); 160 web_state()->GetNavigationManager()->LoadURLWithParams(load_params);
161 161
162 // Wait until |TestUIHandler| receives "ack" message from WebUI page. 162 // Wait until |TestUIHandler| receives "ack" message from WebUI page.
163 base::test::ios::WaitUntilCondition(^{ 163 base::test::ios::WaitUntilCondition(^{
164 base::RunLoop().RunUntilIdle(); 164 base::RunLoop().RunUntilIdle();
165 return test_ui_handler()->IsFinReceived(); 165 return test_ui_handler()->IsFinReceived();
166 }); 166 });
167 } 167 }
168 168
169 } // namespace web 169 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/web_state/web_state_impl_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698