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

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

Issue 2755823002: Moved |openedByDOM| to WebState's CreateParams and public interface. (Closed)
Patch Set: . 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/webui/crw_web_ui_manager_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 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 private: 126 private:
127 // UI handler class which communicates with test WebUI page. 127 // UI handler class which communicates with test WebUI page.
128 TestUIHandler* ui_handler_; 128 TestUIHandler* ui_handler_;
129 }; 129 };
130 } // namespace 130 } // namespace
131 131
132 // A test fixture for verifying mojo comminication for WebUI. 132 // A test fixture for verifying mojo comminication for WebUI.
133 class WebUIMojoTest : public WebIntTest { 133 class WebUIMojoTest : public WebIntTest {
134 protected: 134 protected:
135 WebUIMojoTest() 135 WebUIMojoTest() : ui_handler_(new TestUIHandler()) {
136 : web_state_(new WebStateImpl(GetBrowserState())), 136 web::WebState::CreateParams params(GetBrowserState());
137 ui_handler_(new TestUIHandler()) { 137 web_state_ = base::MakeUnique<web::WebStateImpl>(params);
138 web_state_->GetNavigationManagerImpl().InitializeSession(NO); 138 web_state_->GetNavigationManagerImpl().InitializeSession();
139 WebUIIOSControllerFactory::RegisterFactory( 139 WebUIIOSControllerFactory::RegisterFactory(
140 new TestWebUIControllerFactory(ui_handler_.get())); 140 new TestWebUIControllerFactory(ui_handler_.get()));
141 } 141 }
142 142
143 // Returns WebState which loads test WebUI page. 143 // Returns WebState which loads test WebUI page.
144 WebStateImpl* web_state() { return web_state_.get(); } 144 WebStateImpl* web_state() { return web_state_.get(); }
145 // Returns UI handler which communicates with WebUI page. 145 // Returns UI handler which communicates with WebUI page.
146 TestUIHandler* test_ui_handler() { return ui_handler_.get(); } 146 TestUIHandler* test_ui_handler() { return ui_handler_.get(); }
147 147
148 private: 148 private:
(...skipping 21 matching lines...) Expand all
170 // of this hack. 170 // of this hack.
171 base::RunLoop loop; 171 base::RunLoop loop;
172 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 172 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
173 loop.QuitClosure()); 173 loop.QuitClosure());
174 loop.Run(); 174 loop.Run();
175 return test_ui_handler()->IsFinReceived(); 175 return test_ui_handler()->IsFinReceived();
176 }); 176 });
177 } 177 }
178 178
179 } // namespace web 179 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/webui/crw_web_ui_manager_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698