OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 89 } |
90 | 90 |
91 void TestOverscrollNavigation(bool touch_handler) { | 91 void TestOverscrollNavigation(bool touch_handler) { |
92 ASSERT_NO_FATAL_FAILURE( | 92 ASSERT_NO_FATAL_FAILURE( |
93 StartTestWithPage("files/overscroll_navigation.html")); | 93 StartTestWithPage("files/overscroll_navigation.html")); |
94 WebContentsImpl* web_contents = | 94 WebContentsImpl* web_contents = |
95 static_cast<WebContentsImpl*>(shell()->web_contents()); | 95 static_cast<WebContentsImpl*>(shell()->web_contents()); |
96 NavigationController& controller = web_contents->GetController(); | 96 NavigationController& controller = web_contents->GetController(); |
97 RenderViewHostImpl* view_host = static_cast<RenderViewHostImpl*>( | 97 RenderViewHostImpl* view_host = static_cast<RenderViewHostImpl*>( |
98 web_contents->GetRenderViewHost()); | 98 web_contents->GetRenderViewHost()); |
| 99 WebContentsViewAura* view_aura = static_cast<WebContentsViewAura*>( |
| 100 web_contents->GetView()); |
| 101 view_aura->SetupOverlayWindowForTesting(); |
99 | 102 |
100 EXPECT_FALSE(controller.CanGoBack()); | 103 EXPECT_FALSE(controller.CanGoBack()); |
101 EXPECT_FALSE(controller.CanGoForward()); | 104 EXPECT_FALSE(controller.CanGoForward()); |
102 int index = -1; | 105 int index = -1; |
103 scoped_ptr<base::Value> value = | 106 scoped_ptr<base::Value> value = |
104 content::ExecuteScriptAndGetValue(view_host, "get_current()"); | 107 content::ExecuteScriptAndGetValue(view_host, "get_current()"); |
105 ASSERT_TRUE(value->GetAsInteger(&index)); | 108 ASSERT_TRUE(value->GetAsInteger(&index)); |
106 EXPECT_EQ(0, index); | 109 EXPECT_EQ(0, index); |
107 | 110 |
108 if (touch_handler) | 111 if (touch_handler) |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 web_contents->GetController().GetEntryAtOffset(-1)); | 411 web_contents->GetController().GetEntryAtOffset(-1)); |
409 EXPECT_TRUE(entry->screenshot().get()); | 412 EXPECT_TRUE(entry->screenshot().get()); |
410 | 413 |
411 entry = NavigationEntryImpl::FromNavigationEntry( | 414 entry = NavigationEntryImpl::FromNavigationEntry( |
412 web_contents->GetController().GetActiveEntry()); | 415 web_contents->GetController().GetActiveEntry()); |
413 EXPECT_FALSE(entry->screenshot().get()); | 416 EXPECT_FALSE(entry->screenshot().get()); |
414 } | 417 } |
415 } | 418 } |
416 | 419 |
417 } // namespace content | 420 } // namespace content |
OLD | NEW |