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

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

Issue 402066: Moved a whole pile of unittests over to CocoaTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/tab_controller_unittest.mm
===================================================================
--- chrome/browser/cocoa/tab_controller_unittest.mm (revision 32421)
+++ chrome/browser/cocoa/tab_controller_unittest.mm (working copy)
@@ -63,17 +63,15 @@
namespace {
// The dragging code in TabView makes heavy use of autorelease pools so
-// inherit from Platform test to have one created for us.
-class TabControllerTest : public PlatformTest {
+// inherit from CocoaTest to have one created for us.
+class TabControllerTest : public CocoaTest {
public:
TabControllerTest() { }
-
- CocoaTestHelper cocoa_helper_; // Inits Cocoa, creates window, etc...
};
// Tests creating the controller, sticking it in a window, and removing it.
TEST_F(TabControllerTest, Creation) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
EXPECT_TRUE([controller tabView]);
@@ -85,7 +83,7 @@
// Tests sending it a close message and ensuring that the target/action get
// called. Mimics the user clicking on the close button in the tab.
TEST_F(TabControllerTest, Close) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
@@ -103,7 +101,7 @@
// Tests setting the |selected| property via code.
TEST_F(TabControllerTest, APISelection) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
@@ -116,7 +114,7 @@
// Tests that setting the title of a tab sets the tooltip as well.
TEST_F(TabControllerTest, ToolTip) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
@@ -129,7 +127,7 @@
// Tests setting the |loading| property via code.
TEST_F(TabControllerTest, Loading) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
@@ -152,7 +150,7 @@
// we can dependency-inject/mock so it has very simple click behavior for unit
// testing.
TEST_F(TabControllerTest, UserSelection) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
// Create a tab at a known location in the window that we can click on
// to activate selection.
@@ -201,7 +199,7 @@
}
TEST_F(TabControllerTest, IconCapacity) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
int cap = [controller iconCapacity];
@@ -215,7 +213,7 @@
}
TEST_F(TabControllerTest, ShouldShowIcon) {
- NSWindow* window = cocoa_helper_.window();
+ NSWindow* window = test_window();
scoped_nsobject<TabController> controller([[TabController alloc] init]);
[[window contentView] addSubview:[controller view]];
int cap = [controller iconCapacity];
« no previous file with comments | « chrome/browser/cocoa/styled_text_field_cell_unittest.mm ('k') | chrome/browser/cocoa/tab_strip_view_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698