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

Side by Side Diff: content/browser/web_contents/web_contents_impl_browsertest.cc

Issue 2640473003: Convert tests to use the non-deprecated WebContentsObserver navigation methods. (Closed)
Patch Set: split off SearchTabHelper test Created 3 years, 11 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "content/browser/frame_host/navigation_entry_impl.h" 10 #include "content/browser/frame_host/navigation_entry_impl.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 : WebContentsObserver(shell->web_contents()), 151 : WebContentsObserver(shell->web_contents()),
152 shell_(shell), 152 shell_(shell),
153 wcv_new_size_(wcv_new_size) { 153 wcv_new_size_(wcv_new_size) {
154 } 154 }
155 155
156 // WebContentsObserver: 156 // WebContentsObserver:
157 void RenderViewCreated(RenderViewHost* rvh) override { 157 void RenderViewCreated(RenderViewHost* rvh) override {
158 rwhv_create_size_ = rvh->GetWidget()->GetView()->GetViewBounds().size(); 158 rwhv_create_size_ = rvh->GetWidget()->GetView()->GetViewBounds().size();
159 } 159 }
160 160
161 void DidStartProvisionalLoadForFrame(RenderFrameHost* render_frame_host, 161 void DidStartNavigation(NavigationHandle* navigation_handle) override {
clamy 2017/01/18 14:33:34 Should we exclude same page navigation? They would
jam 2017/01/18 16:35:21 this is only used by a single test which doesn't n
clamy 2017/01/19 14:59:37 Acknowledged.
162 const GURL& url,
163 bool is_error_page) override {
164 ResizeWebContentsView(shell_, wcv_new_size_, false); 162 ResizeWebContentsView(shell_, wcv_new_size_, false);
165 } 163 }
166 164
167 gfx::Size rwhv_create_size() const { return rwhv_create_size_; } 165 gfx::Size rwhv_create_size() const { return rwhv_create_size_; }
168 166
169 private: 167 private:
170 Shell* shell_; // Weak ptr. 168 Shell* shell_; // Weak ptr.
171 gfx::Size wcv_new_size_; 169 gfx::Size wcv_new_size_;
172 gfx::Size rwhv_create_size_; 170 gfx::Size rwhv_create_size_;
173 }; 171 };
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 // Make sure the WebContents cleaned up the previous pending request. A new 1320 // Make sure the WebContents cleaned up the previous pending request. A new
1323 // request should be forwarded to the WebContentsDelegate. 1321 // request should be forwarded to the WebContentsDelegate.
1324 delegate.get()->request_to_lock_mouse_called_ = false; 1322 delegate.get()->request_to_lock_mouse_called_ = false;
1325 ASSERT_TRUE(ExecuteScript(shell(), 1323 ASSERT_TRUE(ExecuteScript(shell(),
1326 "window.domAutomationController.send(document.body." 1324 "window.domAutomationController.send(document.body."
1327 "requestPointerLock());")); 1325 "requestPointerLock());"));
1328 EXPECT_TRUE(delegate.get()->request_to_lock_mouse_called_); 1326 EXPECT_TRUE(delegate.get()->request_to_lock_mouse_called_);
1329 } 1327 }
1330 1328
1331 } // namespace content 1329 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698