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

Side by Side Diff: ios/web/public/test/web_test_with_web_state.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
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 #import "ios/web/public/test/web_test_with_web_state.h" 5 #import "ios/web/public/test/web_test_with_web_state.h"
6 6
7 #include "base/run_loop.h" 7 #include "base/run_loop.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #import "base/test/ios/wait_util.h" 9 #import "base/test/ios/wait_util.h"
10 #include "ios/web/public/web_state/url_verification_constants.h" 10 #include "ios/web/public/web_state/url_verification_constants.h"
(...skipping 11 matching lines...) Expand all
22 } // namespace 22 } // namespace
23 23
24 namespace web { 24 namespace web {
25 25
26 WebTestWithWebState::WebTestWithWebState() {} 26 WebTestWithWebState::WebTestWithWebState() {}
27 27
28 WebTestWithWebState::~WebTestWithWebState() {} 28 WebTestWithWebState::~WebTestWithWebState() {}
29 29
30 void WebTestWithWebState::SetUp() { 30 void WebTestWithWebState::SetUp() {
31 WebTest::SetUp(); 31 WebTest::SetUp();
32 std::unique_ptr<WebStateImpl> web_state(new WebStateImpl(GetBrowserState())); 32 web::WebState::CreateParams params(GetBrowserState());
33 web_state->GetNavigationManagerImpl().InitializeSession(NO); 33 web_state_ = web::WebState::Create(params);
34 web_state->SetWebUsageEnabled(true); 34 web_state_->SetWebUsageEnabled(true);
35 web_state_.reset(web_state.release());
36 35
37 // Force generation of child views; necessary for some tests. 36 // Force generation of child views; necessary for some tests.
38 [GetWebController(web_state_.get()) triggerPendingLoad]; 37 [GetWebController(web_state()) triggerPendingLoad];
39 } 38 }
40 39
41 void WebTestWithWebState::TearDown() { 40 void WebTestWithWebState::TearDown() {
42 DestroyWebState(); 41 DestroyWebState();
43 WebTest::TearDown(); 42 WebTest::TearDown();
44 } 43 }
45 44
46 void WebTestWithWebState::LoadHtml(NSString* html, const GURL& url) { 45 void WebTestWithWebState::LoadHtml(NSString* html, const GURL& url) {
47 // Sets MIME type to "text/html" once navigation is committed. 46 // Sets MIME type to "text/html" once navigation is committed.
48 class MimeTypeUpdater : public WebStateObserver { 47 class MimeTypeUpdater : public WebStateObserver {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 150
152 void WebTestWithWebState::WillProcessTask(const base::PendingTask&) { 151 void WebTestWithWebState::WillProcessTask(const base::PendingTask&) {
153 // Nothing to do. 152 // Nothing to do.
154 } 153 }
155 154
156 void WebTestWithWebState::DidProcessTask(const base::PendingTask&) { 155 void WebTestWithWebState::DidProcessTask(const base::PendingTask&) {
157 processed_a_task_ = true; 156 processed_a_task_ = true;
158 } 157 }
159 158
160 } // namespace web 159 } // namespace web
OLDNEW
« no previous file with comments | « ios/web/public/test/fakes/test_web_state_delegate.mm ('k') | ios/web/public/web_state/web_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698