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()); |
42 return web_contents; | 43 return web_contents; |
43 } | 44 } |
44 | 45 |
45 void ResetNativeView() { fake_native_view_.reset(); } | 46 void ResetNativeView() { fake_native_view_.reset(); } |
46 | 47 |
47 void ResetContentNativeView() { fake_contents_window_.reset(); } | 48 void ResetContentNativeView() { fake_contents_window_.reset(); } |
48 | 49 |
49 void set_is_being_destroyed(bool val) { is_being_destroyed_ = val; } | 50 void set_is_being_destroyed(bool val) { is_being_destroyed_ = val; } |
50 | 51 |
51 gfx::NativeView GetNativeView() override { return fake_native_view_.get(); } | 52 gfx::NativeView GetNativeView() override { return fake_native_view_.get(); } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 EXPECT_TRUE(GetOverlay()->window_.get()); | 399 EXPECT_TRUE(GetOverlay()->window_.get()); |
399 | 400 |
400 // Load the page. | 401 // Load the page. |
401 contents()->CommitPendingNavigation(); | 402 contents()->CommitPendingNavigation(); |
402 ReceivePaintUpdate(); | 403 ReceivePaintUpdate(); |
403 EXPECT_FALSE(GetOverlay()->window_.get()); | 404 EXPECT_FALSE(GetOverlay()->window_.get()); |
404 EXPECT_EQ(contents()->GetURL(), first()); | 405 EXPECT_EQ(contents()->GetURL(), first()); |
405 } | 406 } |
406 | 407 |
407 } // namespace content | 408 } // namespace content |
OLD | NEW |