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

Unified Diff: chrome/renderer/webview_animating_overlay_browsertest.cc

Issue 10855151: Gradient overlay for constrained window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix chromeos 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
« no previous file with comments | « chrome/renderer/webview_animating_overlay.cc ('k') | content/public/renderer/render_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webview_animating_overlay_browsertest.cc
diff --git a/chrome/renderer/webview_animating_overlay_browsertest.cc b/chrome/renderer/webview_animating_overlay_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..19ebb44350ea201506d335b77d9b94a1f2abf0bc
--- /dev/null
+++ b/chrome/renderer/webview_animating_overlay_browsertest.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 "chrome/test/base/chrome_render_view_test.h"
+#include "skia/ext/platform_canvas.h"
+#include "webkit/glue/webkit_glue.h"
+
+typedef ChromeRenderViewTest 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));
+}
« no previous file with comments | « chrome/renderer/webview_animating_overlay.cc ('k') | content/public/renderer/render_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698