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

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

Issue 102015: Add a very basic preferences window controller with unit test. Fix the prefs ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 8 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/preferences_window_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/preferences_window_controller_unittest.mm (revision 0)
+++ chrome/browser/cocoa/preferences_window_controller_unittest.mm (revision 0)
@@ -0,0 +1,36 @@
+// Copyright (c) 2009 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/scoped_nsobject.h"
+#import "chrome/browser/cocoa/preferences_window_controller.h"
+#include "chrome/browser/cocoa/browser_test_helper.h"
+#include "chrome/browser/cocoa/cocoa_test_helper.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+namespace {
+
+class PrefsControllerTest : public PlatformTest {
+ public:
+ PrefsControllerTest() {
+ PrefService* prefs = browser_helper_.profile()->GetPrefs();
+ pref_controller_.reset([[PreferencesWindowController alloc]
+ initWithPrefs:prefs]);
+ EXPECT_TRUE(pref_controller_.get());
+ }
+
+ BrowserTestHelper browser_helper_;
+ CocoaTestHelper cocoa_helper_; // Inits Cocoa, creates window, etc...
+ scoped_nsobject<PreferencesWindowController> pref_controller_;
+};
+
+// Test showing the preferences window and making sure it's visible
+TEST_F(PrefsControllerTest, Show) {
+ [pref_controller_ showPreferences:nil];
+ EXPECT_TRUE([[pref_controller_ window] isVisible]);
+}
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698