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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 void set_min_screenshot_interval(int interval_ms) { | 260 void set_min_screenshot_interval(int interval_ms) { |
261 screenshot_manager_->SetScreenshotInterval(interval_ms); | 261 screenshot_manager_->SetScreenshotInterval(interval_ms); |
262 } | 262 } |
263 | 263 |
264 private: | 264 private: |
265 ScreenshotTracker* screenshot_manager_; | 265 ScreenshotTracker* screenshot_manager_; |
266 | 266 |
267 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAuraTest); | 267 DISALLOW_COPY_AND_ASSIGN(WebContentsViewAuraTest); |
268 }; | 268 }; |
269 | 269 |
270 // Flaky on Windows and ChromeOS: http://crbug.com/305722 | 270 // Flaky on Windows: http://crbug.com/305722 |
271 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, | 271 #if defined(OS_WIN) |
272 DISABLED_OverscrollNavigation) { | 272 #define MAYBE_OverscrollNavigation DISABLED_OverscrollNavigation |
| 273 #else |
| 274 #define MAYBE_OverscrollNavigation OverscrollNavigation |
| 275 #endif |
| 276 |
| 277 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, MAYBE_OverscrollNavigation) { |
273 TestOverscrollNavigation(false); | 278 TestOverscrollNavigation(false); |
274 } | 279 } |
275 | 280 |
276 // Flaky on Windows (might be related to the above test): | 281 // Flaky on Windows (might be related to the above test): |
277 // http://crbug.com/305722 | 282 // http://crbug.com/305722 |
278 #if defined(OS_WIN) | 283 #if defined(OS_WIN) |
279 #define MAYBE_OverscrollNavigationWithTouchHandler \ | 284 #define MAYBE_OverscrollNavigationWithTouchHandler \ |
280 DISABLED_OverscrollNavigationWithTouchHandler | 285 DISABLED_OverscrollNavigationWithTouchHandler |
281 #else | 286 #else |
282 #define MAYBE_OverscrollNavigationWithTouchHandler \ | 287 #define MAYBE_OverscrollNavigationWithTouchHandler \ |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 } | 375 } |
371 | 376 |
372 // Do not end the overscroll sequence. | 377 // Do not end the overscroll sequence. |
373 } | 378 } |
374 | 379 |
375 // Tests that the page has has a screenshot when navigation happens: | 380 // Tests that the page has has a screenshot when navigation happens: |
376 // - from within the page (from a JS function) | 381 // - from within the page (from a JS function) |
377 // - interactively, when user does an overscroll gesture | 382 // - interactively, when user does an overscroll gesture |
378 // - interactively, when user navigates in history without the overscroll | 383 // - interactively, when user navigates in history without the overscroll |
379 // gesture. | 384 // gesture. |
380 // Flaky on Windows and ChromeOS (http://crbug.com/357311). Might be related to | 385 // Flaky on Windows (http://crbug.com/357311). Might be related to |
381 // OverscrollNavigation test. | 386 // OverscrollNavigation test. |
382 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, DISABLED_OverscrollScreenshot) { | 387 #if defined(OS_WIN) |
| 388 #define MAYBE_OverscrollScreenshot DISABLED_OverscrollScreenshot |
| 389 #else |
| 390 #define MAYBE_OverscrollScreenshot OverscrollScreenshot |
| 391 #endif |
| 392 |
| 393 IN_PROC_BROWSER_TEST_F(WebContentsViewAuraTest, MAYBE_OverscrollScreenshot) { |
383 // Disable the test for WinXP. See http://crbug/294116. | 394 // Disable the test for WinXP. See http://crbug/294116. |
384 #if defined(OS_WIN) | 395 #if defined(OS_WIN) |
385 if (base::win::GetVersion() < base::win::VERSION_VISTA) { | 396 if (base::win::GetVersion() < base::win::VERSION_VISTA) { |
386 LOG(WARNING) << "Test disabled due to unknown bug on WinXP."; | 397 LOG(WARNING) << "Test disabled due to unknown bug on WinXP."; |
387 return; | 398 return; |
388 } | 399 } |
389 #endif | 400 #endif |
390 | 401 |
391 ASSERT_NO_FATAL_FAILURE( | 402 ASSERT_NO_FATAL_FAILURE( |
392 StartTestWithPage("files/overscroll_navigation.html")); | 403 StartTestWithPage("files/overscroll_navigation.html")); |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 static_cast<WebContentsImpl*>(shell()->web_contents()); | 720 static_cast<WebContentsImpl*>(shell()->web_contents()); |
710 aura::Window* content = web_contents->GetNativeView()->parent(); | 721 aura::Window* content = web_contents->GetNativeView()->parent(); |
711 EXPECT_TRUE(web_contents->should_normally_be_visible()); | 722 EXPECT_TRUE(web_contents->should_normally_be_visible()); |
712 content->Hide(); | 723 content->Hide(); |
713 EXPECT_FALSE(web_contents->should_normally_be_visible()); | 724 EXPECT_FALSE(web_contents->should_normally_be_visible()); |
714 content->Show(); | 725 content->Show(); |
715 EXPECT_TRUE(web_contents->should_normally_be_visible()); | 726 EXPECT_TRUE(web_contents->should_normally_be_visible()); |
716 } | 727 } |
717 | 728 |
718 } // namespace content | 729 } // namespace content |
OLD | NEW |