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

Side by Side Diff: content/browser/web_contents/aura/overscroll_navigation_overlay_unittest.cc

Issue 1151973005: Bring RFH/RVH unit tests closer to reality of how RF/RV are initialized (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add workaround to <webview> bug (492830) Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/web_contents/aura/overscroll_navigation_overlay.h" 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h"
6 6
7 #include <vector> 7 #include <vector>
8 #include "content/browser/frame_host/navigation_entry_impl.h" 8 #include "content/browser/frame_host/navigation_entry_impl.h"
9 #include "content/browser/web_contents/web_contents_view.h" 9 #include "content/browser/web_contents/web_contents_view.h"
10 #include "content/common/frame_messages.h" 10 #include "content/common/frame_messages.h"
(...skipping 21 matching lines...) Expand all
32 ~OverscrollTestWebContents() override {} 32 ~OverscrollTestWebContents() override {}
33 33
34 static OverscrollTestWebContents* Create( 34 static OverscrollTestWebContents* Create(
35 BrowserContext* browser_context, 35 BrowserContext* browser_context,
36 SiteInstance* instance, 36 SiteInstance* instance,
37 scoped_ptr<aura::Window> fake_native_view, 37 scoped_ptr<aura::Window> fake_native_view,
38 scoped_ptr<aura::Window> fake_contents_window) { 38 scoped_ptr<aura::Window> fake_contents_window) {
39 OverscrollTestWebContents* web_contents = new OverscrollTestWebContents( 39 OverscrollTestWebContents* web_contents = new OverscrollTestWebContents(
40 browser_context, fake_native_view.Pass(), fake_contents_window.Pass()); 40 browser_context, fake_native_view.Pass(), fake_contents_window.Pass());
41 web_contents->Init(WebContents::CreateParams(browser_context, instance)); 41 web_contents->Init(WebContents::CreateParams(browser_context, instance));
42 web_contents->RenderFrameCreated(web_contents->GetMainFrame());
43 return web_contents; 42 return web_contents;
44 } 43 }
45 44
46 void ResetNativeView() { fake_native_view_.reset(); } 45 void ResetNativeView() { fake_native_view_.reset(); }
47 46
48 void ResetContentNativeView() { fake_contents_window_.reset(); } 47 void ResetContentNativeView() { fake_contents_window_.reset(); }
49 48
50 void set_is_being_destroyed(bool val) { is_being_destroyed_ = val; } 49 void set_is_being_destroyed(bool val) { is_being_destroyed_ = val; }
51 50
52 gfx::NativeView GetNativeView() override { return fake_native_view_.get(); } 51 gfx::NativeView GetNativeView() override { return fake_native_view_.get(); }
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 EXPECT_TRUE(GetOverlay()->window_.get()); 398 EXPECT_TRUE(GetOverlay()->window_.get());
400 399
401 // Load the page. 400 // Load the page.
402 contents()->CommitPendingNavigation(); 401 contents()->CommitPendingNavigation();
403 ReceivePaintUpdate(); 402 ReceivePaintUpdate();
404 EXPECT_FALSE(GetOverlay()->window_.get()); 403 EXPECT_FALSE(GetOverlay()->window_.get());
405 EXPECT_EQ(contents()->GetURL(), first()); 404 EXPECT_EQ(contents()->GetURL(), first());
406 } 405 }
407 406
408 } // namespace content 407 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698