Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4021)

Unified Diff: chrome/renderer/webview_animating_overlay_unittest.cc

Issue 10855151: Gradient overlay for constrained window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/renderer/webview_animating_overlay_unittest.cc
diff --git a/chrome/renderer/webview_animating_overlay_unittest.cc b/chrome/renderer/webview_animating_overlay_unittest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2ce670f75a4998cbe9f9cef736a0920ad4dbed5d
--- /dev/null
+++ b/chrome/renderer/webview_animating_overlay_unittest.cc
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/renderer/webview_animating_overlay.h"
+
+#include "content/public/test/render_view_test.h"
+#include "skia/ext/platform_canvas.h"
+#include "webkit/glue/webkit_glue.h"
+
+typedef content::RenderViewTest WebViewAnimatingOverlayTest;
+
+TEST_F(WebViewAnimatingOverlayTest, ShowHide) {
+ WebViewAnimatingOverlay overlay(view_);
+ EXPECT_EQ(overlay.state(), WebViewAnimatingOverlay::HIDDEN);
+ overlay.Show();
+ EXPECT_EQ(overlay.state(), WebViewAnimatingOverlay::ANIMATING_IN);
+ overlay.Hide();
+ EXPECT_EQ(overlay.state(), WebViewAnimatingOverlay::ANIMATING_OUT);
+}
+
+TEST_F(WebViewAnimatingOverlayTest, Paint) {
+ gfx::Size view_size(100, 100);
+ Resize(view_size, gfx::Rect(), false);
+
+ WebViewAnimatingOverlay overlay(view_);
+ overlay.Show();
+
+ skia::PlatformCanvas canvas;
+ ASSERT_TRUE(canvas.initialize(view_size.width(), view_size.height(), true));
+ overlay.paintPageOverlay(webkit_glue::ToWebCanvas(&canvas));
+}
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

Powered by Google App Engine
This is Rietveld 408576698