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

Unified Diff: chrome/browser/cocoa/animatable_image_unittest.mm

Issue 3014005: [Mac] Display a quick animation when a popup is blocked so the user notices it in the Omnibox. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: CGImage Created 10 years, 5 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/browser/cocoa/animatable_image_unittest.mm
diff --git a/chrome/browser/cocoa/animatable_image_unittest.mm b/chrome/browser/cocoa/animatable_image_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..2fc95772b9b8472b48535af6c4c095e8db803e28
--- /dev/null
+++ b/chrome/browser/cocoa/animatable_image_unittest.mm
@@ -0,0 +1,36 @@
+// Copyright (c) 2010 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.
+
+#import <Cocoa/Cocoa.h>
+
+#import "base/nsimage_cache_mac.h"
+#import "chrome/browser/cocoa/animatable_image.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+namespace {
+
+class AnimatableImageTest : public CocoaTest {
+ public:
+ AnimatableImageTest() {
+ NSRect frame = NSMakeRect(0, 0, 500, 500);
+ NSImage* image = nsimage_cache::ImageNamed(@"forward_Template.pdf");
+ animation_ = [[AnimatableImage alloc] initWithImage:image
+ animationFrame:frame];
+ }
+
+ AnimatableImage* animation_;
+};
+
+TEST_F(AnimatableImageTest, BasicAnimation) {
+ [animation_ setStartFrame:CGRectMake(0, 0, 10, 10)];
+ [animation_ setEndFrame:CGRectMake(500, 500, 100, 100)];
+ [animation_ setStartOpacity:0.1];
+ [animation_ setEndOpacity:1.0];
+ [animation_ setDuration:0.5];
+ [animation_ startAnimation];
+}
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698