OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |