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

Unified Diff: chrome/browser/ui/cocoa/spinner_progress_indicator_unittest.mm

Issue 11009017: Mac Web Intents Part 11: Progress view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: a Created 8 years, 2 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/browser/ui/cocoa/spinner_progress_indicator.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/spinner_progress_indicator_unittest.mm
diff --git a/chrome/browser/ui/cocoa/spinner_progress_indicator_unittest.mm b/chrome/browser/ui/cocoa/spinner_progress_indicator_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..3fec8ab5eb046204d25f05944dd25a4cde3c4e5c
--- /dev/null
+++ b/chrome/browser/ui/cocoa/spinner_progress_indicator_unittest.mm
@@ -0,0 +1,41 @@
+// 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.
+
+#import "base/memory/scoped_nsobject.h"
+#include "base/message_loop.h"
+#import "chrome/browser/ui/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/ui/cocoa/spinner_progress_indicator.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+class SpinnerProgressIndicatorTest : public CocoaTest {
+ public:
+ SpinnerProgressIndicatorTest() {
+ view_.reset([[SpinnerProgressIndicator alloc] initWithFrame:NSZeroRect]);
+ [view_ sizeToFit];
+ [[test_window() contentView] addSubview:view_];
+ }
+
+ protected:
+ scoped_nsobject<SpinnerProgressIndicator> view_;
+ // Need for the progress indicator timer.
+ MessageLoop message_loop_;
+};
+
+TEST_VIEW(SpinnerProgressIndicatorTest, view_)
+
+// Test determinate.
+TEST_F(SpinnerProgressIndicatorTest, Determinate) {
+ [view_ setIsIndeterminate:NO];
+ [view_ setPercentDone:0];
+ [view_ display];
+ [view_ setPercentDone:50];
+ [view_ display];
+}
+
+// Test indeterminate.
+TEST_F(SpinnerProgressIndicatorTest, Indeterminate) {
+ [view_ setIsIndeterminate:YES];
+ [view_ display];
+}
« no previous file with comments | « chrome/browser/ui/cocoa/spinner_progress_indicator.mm ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698