OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/renderer/webview_animating_overlay.h" | |
6 | |
7 #include "content/public/test/render_view_test.h" | |
8 #include "skia/ext/platform_canvas.h" | |
9 #include "webkit/glue/webkit_glue.h" | |
10 | |
11 typedef content::RenderViewTest WebViewAnimatingOverlayTest; | |
12 | |
13 TEST_F(WebViewAnimatingOverlayTest, ShowHide) { | |
14 WebViewAnimatingOverlay overlay(view_); | |
15 EXPECT_EQ(overlay.state(), WebViewAnimatingOverlay::HIDDEN); | |
16 overlay.Show(); | |
17 EXPECT_EQ(overlay.state(), WebViewAnimatingOverlay::ANIMATING_IN); | |
18 overlay.Hide(); | |
19 EXPECT_EQ(overlay.state(), WebViewAnimatingOverlay::ANIMATING_OUT); | |
20 } | |
21 | |
22 TEST_F(WebViewAnimatingOverlayTest, Paint) { | |
23 gfx::Size view_size(100, 100); | |
24 Resize(view_size, gfx::Rect(), false); | |
25 | |
26 WebViewAnimatingOverlay overlay(view_); | |
27 overlay.Show(); | |
28 | |
29 skia::PlatformCanvas canvas; | |
30 ASSERT_TRUE(canvas.initialize(view_size.width(), view_size.height(), true)); | |
31 overlay.paintPageOverlay(webkit_glue::ToWebCanvas(&canvas)); | |
32 } | |
Nico
2012/08/14 21:14:12
If it's not too difficult, a test that starts the
sail
2012/08/15 05:26:20
Eek. This will require a WebKit patch. If you stil
| |
OLD | NEW |