summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 20:43:07 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 20:43:07 +0000
commit70d5c1855389c27f5c1246859feaead6d96b560d (patch)
tree4eac1e562417f24f48000b7ebef3b08c18cc3df2 /chrome/browser
parent7923c790ae1fe65b26cc08bbaf043c28d47e3cc7 (diff)
downloadchromium_src-70d5c1855389c27f5c1246859feaead6d96b560d.zip
chromium_src-70d5c1855389c27f5c1246859feaead6d96b560d.tar.gz
chromium_src-70d5c1855389c27f5c1246859feaead6d96b560d.tar.bz2
[Mac] Use the new {EXPECT,ASSERT}_NS{EQ,NE} macros in unit tests where possible.
BUG=none TEST=unit_tests Review URL: http://codereview.chromium.org/3095004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55280 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/about_window_controller_unittest.mm25
-rw-r--r--chrome/browser/cocoa/accelerators_cocoa_unittest.mm3
-rw-r--r--chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm5
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller_unittest.mm69
-rw-r--r--chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm37
-rw-r--r--chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm5
-rw-r--r--chrome/browser/cocoa/bookmark_editor_base_controller_unittest.mm3
-rw-r--r--chrome/browser/cocoa/bookmark_editor_controller_unittest.mm15
-rw-r--r--chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm7
-rw-r--r--chrome/browser/cocoa/bookmark_name_folder_controller_unittest.mm3
-rw-r--r--chrome/browser/cocoa/browser_accessibility_unittest.mm15
-rw-r--r--chrome/browser/cocoa/bubble_view_unittest.mm5
-rw-r--r--chrome/browser/cocoa/bug_report_window_controller_unittest.mm5
-rw-r--r--chrome/browser/cocoa/chrome_browser_window_unittest.mm3
-rw-r--r--chrome/browser/cocoa/cookie_details_unittest.mm58
-rw-r--r--chrome/browser/cocoa/cookies_window_controller_unittest.mm100
-rw-r--r--chrome/browser/cocoa/custom_home_pages_model_unittest.mm17
-rw-r--r--chrome/browser/cocoa/download_util_mac_unittest.mm3
-rw-r--r--chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm33
-rw-r--r--chrome/browser/cocoa/extensions/extension_install_prompt_controller_unittest.mm10
-rw-r--r--chrome/browser/cocoa/font_language_settings_controller_unittest.mm7
-rw-r--r--chrome/browser/cocoa/history_menu_bridge_unittest.mm35
-rw-r--r--chrome/browser/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm13
-rw-r--r--chrome/browser/cocoa/location_bar/autocomplete_text_field_unittest.mm9
-rw-r--r--chrome/browser/cocoa/location_bar/selected_keyword_decoration_unittest.mm9
-rw-r--r--chrome/browser/cocoa/preferences_window_controller_unittest.mm20
-rw-r--r--chrome/browser/cocoa/search_engine_list_model_unittest.mm3
-rw-r--r--chrome/browser/cocoa/status_bubble_mac_unittest.mm25
-rw-r--r--chrome/browser/cocoa/tab_controller_unittest.mm3
-rw-r--r--chrome/browser/cocoa/tab_view_picker_table_unittest.mm17
-rw-r--r--chrome/browser/cocoa/task_manager_mac_unittest.mm7
31 files changed, 290 insertions, 279 deletions
diff --git a/chrome/browser/cocoa/about_window_controller_unittest.mm b/chrome/browser/cocoa/about_window_controller_unittest.mm
index 64a4f6d..3538dda 100644
--- a/chrome/browser/cocoa/about_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/about_window_controller_unittest.mm
@@ -10,6 +10,7 @@
#include "chrome/browser/cocoa/cocoa_test_helper.h"
#import "chrome/browser/cocoa/keystone_glue.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
namespace {
@@ -95,28 +96,23 @@ TEST_F(AboutWindowControllerTest, TestCallbacks) {
NSString *lastText = [[about_window_controller_ updateText]
stringValue];
PostAutoupdateStatusNotification(kAutoupdateCurrent, @"foo");
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateCurrent, @"foo");
- ASSERT_TRUE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSEQ(lastText, [[about_window_controller_ updateText] stringValue]);
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateCurrent, @"bar");
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateAvailable, nil);
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateCheckFailed, nil);
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
#if 0
// TODO(mark): The kAutoupdateInstalled portion of the test is disabled
@@ -126,19 +122,16 @@ TEST_F(AboutWindowControllerTest, TestCallbacks) {
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateInstalled, @"ver");
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateInstalled, nil);
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_ updateText]
- stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
#endif
lastText = [[about_window_controller_ updateText] stringValue];
PostAutoupdateStatusNotification(kAutoupdateInstallFailed, nil);
- ASSERT_FALSE([lastText isEqual:[[about_window_controller_
- updateText] stringValue]]);
+ ASSERT_NSNE(lastText, [[about_window_controller_ updateText] stringValue]);
}
} // namespace
diff --git a/chrome/browser/cocoa/accelerators_cocoa_unittest.mm b/chrome/browser/cocoa/accelerators_cocoa_unittest.mm
index cac5c20..28b9986 100644
--- a/chrome/browser/cocoa/accelerators_cocoa_unittest.mm
+++ b/chrome/browser/cocoa/accelerators_cocoa_unittest.mm
@@ -9,13 +9,14 @@
#include "chrome/app/chrome_dll_resource.h"
#import "chrome/browser/cocoa/accelerators_cocoa.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/gtest_mac.h"
TEST(AcceleratorsCocoaTest, GetAccelerator) {
AcceleratorsCocoa* keymap = Singleton<AcceleratorsCocoa>::get();
const menus::AcceleratorCocoa* accelerator =
keymap->GetAcceleratorForCommand(IDC_COPY);
ASSERT_TRUE(accelerator);
- EXPECT_TRUE([@"c" isEqualToString:accelerator->characters()]);
+ EXPECT_NSEQ(@"c", accelerator->characters());
EXPECT_EQ(NSCommandKeyMask, accelerator->modifiers());
}
diff --git a/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm b/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
index d932d74..4588fc7 100644
--- a/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_bridge_unittest.mm
@@ -7,6 +7,7 @@
#include "chrome/browser/cocoa/browser_test_helper.h"
#include "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// TODO(jrg): add OCMock to Chromium to save some typing.
@@ -128,7 +129,7 @@ TEST_F(BookmarkBarBridgeTest, TestRedirect) {
EXPECT_TRUE([controller.get()->callbacks_ count] == 9);
for (int x = 1; x < 9; x++) {
- NSNumber *num = [NSNumber numberWithInt:x-1];
- EXPECT_TRUE([[controller.get()->callbacks_ objectAtIndex:x] isEqual:num]);
+ NSNumber* num = [NSNumber numberWithInt:x-1];
+ EXPECT_NSEQ(num, [controller.get()->callbacks_ objectAtIndex:x]);
}
}
diff --git a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
index 1f09a6b..6b90940 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller_unittest.mm
@@ -24,6 +24,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/test/model_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
@@ -932,7 +933,7 @@ TEST_F(BookmarkBarControllerTest, Cell) {
NSCell* cell = [bar_ cellForBookmarkNode:node];
EXPECT_TRUE(cell);
- EXPECT_TRUE([[cell title] isEqual:@"supertitle"]);
+ EXPECT_NSEQ(@"supertitle", [cell title]);
EXPECT_EQ(node, [[cell representedObject] pointerValue]);
EXPECT_TRUE([cell menu]);
@@ -1112,21 +1113,21 @@ TEST_F(BookmarkBarControllerTest, TestDragButton) {
}
EXPECT_EQ([[bar_ buttons] count], arraysize(titles));
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:0] title] isEqual:@"a"]);
+ EXPECT_NSEQ(@"a", [[[bar_ buttons] objectAtIndex:0] title]);
[bar_ dragButton:[[bar_ buttons] objectAtIndex:2]
to:NSMakePoint(0, 0)
copy:NO];
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:0] title] isEqual:@"c"]);
+ EXPECT_NSEQ(@"c", [[[bar_ buttons] objectAtIndex:0] title]);
// Make sure a 'copy' did not happen.
EXPECT_EQ([[bar_ buttons] count], arraysize(titles));
[bar_ dragButton:[[bar_ buttons] objectAtIndex:1]
to:NSMakePoint(1000, 0)
copy:NO];
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:0] title] isEqual:@"c"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:1] title] isEqual:@"b"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:2] title] isEqual:@"a"]);
+ EXPECT_NSEQ(@"c", [[[bar_ buttons] objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"b", [[[bar_ buttons] objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"a", [[[bar_ buttons] objectAtIndex:2] title]);
EXPECT_EQ([[bar_ buttons] count], arraysize(titles));
// A drop of the 1st between the next 2.
@@ -1135,9 +1136,9 @@ TEST_F(BookmarkBarControllerTest, TestDragButton) {
[bar_ dragButton:[[bar_ buttons] objectAtIndex:0]
to:NSMakePoint(x, 0)
copy:NO];
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:0] title] isEqual:@"b"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:1] title] isEqual:@"c"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:2] title] isEqual:@"a"]);
+ EXPECT_NSEQ(@"b", [[[bar_ buttons] objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"c", [[[bar_ buttons] objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"a", [[[bar_ buttons] objectAtIndex:2] title]);
EXPECT_EQ([[bar_ buttons] count], arraysize(titles));
// A drop on a non-folder button. (Shouldn't try and go in it.)
@@ -1182,7 +1183,7 @@ TEST_F(BookmarkBarControllerTest, TestCopyButton) {
model->SetURLStarred(gurls[i], titles[i], true);
}
EXPECT_EQ([[bar_ buttons] count], arraysize(titles));
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:0] title] isEqual:@"a"]);
+ EXPECT_NSEQ(@"a", [[[bar_ buttons] objectAtIndex:0] title]);
// Drag 'a' between 'b' and 'c'.
CGFloat x = NSMinX([[[bar_ buttons] objectAtIndex:2] frame]);
@@ -1190,10 +1191,10 @@ TEST_F(BookmarkBarControllerTest, TestCopyButton) {
[bar_ dragButton:[[bar_ buttons] objectAtIndex:0]
to:NSMakePoint(x, 0)
copy:YES];
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:0] title] isEqual:@"a"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:1] title] isEqual:@"b"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:2] title] isEqual:@"a"]);
- EXPECT_TRUE([[[[bar_ buttons] objectAtIndex:3] title] isEqual:@"c"]);
+ EXPECT_NSEQ(@"a", [[[bar_ buttons] objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"b", [[[bar_ buttons] objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"a", [[[bar_ buttons] objectAtIndex:2] title]);
+ EXPECT_NSEQ(@"c", [[[bar_ buttons] objectAtIndex:3] title]);
EXPECT_EQ([[bar_ buttons] count], 4U);
}
@@ -1213,12 +1214,12 @@ TEST_F(BookmarkBarControllerTest, TestThemedButton) {
[bar_ updateTheme:&theme];
NSAttributedString* astr = [button attributedTitle];
EXPECT_TRUE(astr);
- EXPECT_TRUE([[astr string] isEqual:@"small"]);
+ EXPECT_NSEQ(@"small", [astr string]);
// Pick a char in the middle to test (index 3)
NSDictionary* attributes = [astr attributesAtIndex:3 effectiveRange:NULL];
NSColor* newColor =
[attributes objectForKey:NSForegroundColorAttributeName];
- EXPECT_TRUE([newColor isEqual:color]);
+ EXPECT_NSEQ(newColor, color);
}
}
@@ -1599,40 +1600,40 @@ TEST_F(BookmarkBarControllerTest, MoveRemoveAddButtons) {
// Move a button around a bit.
[bar_ moveButtonFromIndex:0 toIndex:2];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"2f"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"1b"]);
+ EXPECT_NSEQ(@"2f", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"1b", [[buttons objectAtIndex:2] title]);
EXPECT_EQ(oldDisplayedButtons, [bar_ displayedButtonCount]);
[bar_ moveButtonFromIndex:2 toIndex:0];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"3b"]);
+ EXPECT_NSEQ(@"1b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:2] title]);
EXPECT_EQ(oldDisplayedButtons, [bar_ displayedButtonCount]);
// Add a couple of buttons.
const BookmarkNode* parent = root->GetChild(1); // Purloin an existing node.
const BookmarkNode* node = parent->GetChild(0);
[bar_ addButtonForNode:node atIndex:0];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"2f1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f"]);
- EXPECT_TRUE([[[buttons objectAtIndex:3] title] isEqualToString:@"3b"]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"1b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f", [[buttons objectAtIndex:2] title]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:3] title]);
EXPECT_EQ(oldDisplayedButtons + 1, [bar_ displayedButtonCount]);
node = parent->GetChild(1);
[bar_ addButtonForNode:node atIndex:-1];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"2f1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f"]);
- EXPECT_TRUE([[[buttons objectAtIndex:3] title] isEqualToString:@"3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:4] title] isEqualToString:@"2f2b"]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"1b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f", [[buttons objectAtIndex:2] title]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:3] title]);
+ EXPECT_NSEQ(@"2f2b", [[buttons objectAtIndex:4] title]);
EXPECT_EQ(oldDisplayedButtons + 2, [bar_ displayedButtonCount]);
// Remove a couple of buttons.
[bar_ removeButton:4 animate:NO];
[bar_ removeButton:1 animate:NO];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"2f1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"3b"]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:2] title]);
EXPECT_EQ(oldDisplayedButtons, [bar_ displayedButtonCount]);
}
diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm
index 4080296..0b94654 100644
--- a/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bar_folder_controller_unittest.mm
@@ -16,6 +16,7 @@
#import "chrome/browser/cocoa/view_resizer_pong.h"
#include "chrome/test/model_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// Add a redirect to make testing easier.
@@ -1035,39 +1036,39 @@ TEST_F(BookmarkBarFolderControllerMenuTest, MoveRemoveAddButtons) {
// Move a button around a bit.
[folder moveButtonFromIndex:0 toIndex:2];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"2f2b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f1b"]);
+ EXPECT_NSEQ(@"2f2b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f3b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:2] title]);
EXPECT_EQ(oldDisplayedButtons, [buttons count]);
[folder moveButtonFromIndex:2 toIndex:0];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"2f1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f2b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f3b"]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f2b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f3b", [[buttons objectAtIndex:2] title]);
EXPECT_EQ(oldDisplayedButtons, [buttons count]);
// Add a couple of buttons.
const BookmarkNode* node = root->GetChild(2); // Purloin an existing node.
[folder addButtonForNode:node atIndex:0];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f2b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:3] title] isEqualToString:@"2f3b"]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f2b", [[buttons objectAtIndex:2] title]);
+ EXPECT_NSEQ(@"2f3b", [[buttons objectAtIndex:3] title]);
EXPECT_EQ(oldDisplayedButtons + 1, [buttons count]);
node = root->GetChild(3);
[folder addButtonForNode:node atIndex:-1];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f1b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f2b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:3] title] isEqualToString:@"2f3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:4] title] isEqualToString:@"4b"]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f1b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f2b", [[buttons objectAtIndex:2] title]);
+ EXPECT_NSEQ(@"2f3b", [[buttons objectAtIndex:3] title]);
+ EXPECT_NSEQ(@"4b", [[buttons objectAtIndex:4] title]);
EXPECT_EQ(oldDisplayedButtons + 2, [buttons count]);
// Remove a couple of buttons.
[folder removeButton:4 animate:NO];
[folder removeButton:1 animate:NO];
- EXPECT_TRUE([[[buttons objectAtIndex:0] title] isEqualToString:@"3b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:1] title] isEqualToString:@"2f2b"]);
- EXPECT_TRUE([[[buttons objectAtIndex:2] title] isEqualToString:@"2f3b"]);
+ EXPECT_NSEQ(@"3b", [[buttons objectAtIndex:0] title]);
+ EXPECT_NSEQ(@"2f2b", [[buttons objectAtIndex:1] title]);
+ EXPECT_NSEQ(@"2f3b", [[buttons objectAtIndex:2] title]);
EXPECT_EQ(oldDisplayedButtons, [buttons count]);
}
diff --git a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm
index f437e71..ffe036d 100644
--- a/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_bubble_controller_unittest.mm
@@ -13,6 +13,7 @@
#import "chrome/browser/cocoa/info_bubble_window.h"
#include "chrome/common/notification_service.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// Watch for bookmark pulse notifications so we can confirm they were sent.
@@ -318,11 +319,11 @@ TEST_F(BookmarkBubbleControllerTest, TestDuplicateNodeNames) {
[controller setParentFolderSelection:node1];
NSMenuItem* item = [button selectedItem];
id itemObject = [item representedObject];
- EXPECT_TRUE([itemObject isEqual:[NSValue valueWithPointer:node1]]);
+ EXPECT_NSEQ([NSValue valueWithPointer:node1], itemObject);
[controller setParentFolderSelection:node2];
item = [button selectedItem];
itemObject = [item representedObject];
- EXPECT_TRUE([itemObject isEqual:[NSValue valueWithPointer:node2]]);
+ EXPECT_NSEQ([NSValue valueWithPointer:node2], itemObject);
}
// Click the "remove" button
diff --git a/chrome/browser/cocoa/bookmark_editor_base_controller_unittest.mm b/chrome/browser/cocoa/bookmark_editor_base_controller_unittest.mm
index 17159db..1a0d35b 100644
--- a/chrome/browser/cocoa/bookmark_editor_base_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_editor_base_controller_unittest.mm
@@ -12,6 +12,7 @@
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
class BookmarkEditorBaseControllerTest : public CocoaTest {
@@ -154,7 +155,7 @@ TEST_F(BookmarkEditorBaseControllerTest, CreateFolder) {
BookmarkFolderInfo* newFolderInfo = [controller_ selectedFolder];
EXPECT_TRUE(newFolderInfo);
NSString* newFolderName = [newFolderInfo folderName];
- EXPECT_TRUE([newFolderName isEqualToString:expectedName]);
+ EXPECT_NSEQ(expectedName, newFolderName);
[controller_ createNewFolders];
// Verify that the tab folder was added to the new folder.
EXPECT_EQ(3, group_b_3_->GetChildCount());
diff --git a/chrome/browser/cocoa/bookmark_editor_controller_unittest.mm b/chrome/browser/cocoa/bookmark_editor_controller_unittest.mm
index 209fca2..8d0858b 100644
--- a/chrome/browser/cocoa/bookmark_editor_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_editor_controller_unittest.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/cocoa/browser_test_helper.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
class BookmarkEditorControllerTest : public CocoaTest {
@@ -118,12 +119,12 @@ TEST_F(BookmarkEditorControllerTest, GoodAndBadURLsChangeColor) {
[controller_ setDisplayURL:@""];
NSColor *urlColorB = [controller_ urlFieldColor];
EXPECT_TRUE(urlColorB);
- EXPECT_FALSE([urlColorB isEqual:urlColorA]);
+ EXPECT_NSNE(urlColorA, urlColorB);
[controller_ setDisplayURL:@"http://www.google.com"];
[controller_ cancel:nil];
urlColorB = [controller_ urlFieldColor];
EXPECT_TRUE(urlColorB);
- EXPECT_TRUE([urlColorB isEqual:urlColorA]);
+ EXPECT_NSEQ(urlColorA, urlColorB);
}
class BookmarkEditorControllerNoNodeTest : public CocoaTest {
@@ -190,11 +191,11 @@ class BookmarkEditorControllerYesNodeTest : public CocoaTest {
};
TEST_F(BookmarkEditorControllerYesNodeTest, YesNodeShowTree) {
- EXPECT_TRUE([base::SysWideToNSString(default_title_)
- isEqual:[controller_ displayName]]);
- EXPECT_TRUE([[NSString stringWithCString:url_name_
- encoding:NSUTF8StringEncoding]
- isEqual:[controller_ displayURL]]);
+ EXPECT_NSEQ(base::SysWideToNSString(default_title_),
+ [controller_ displayName]);
+ EXPECT_NSEQ([NSString stringWithCString:url_name_
+ encoding:NSUTF8StringEncoding],
+ [controller_ displayURL]);
[controller_ cancel:nil];
}
diff --git a/chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm b/chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm
index 47585aa..2191310 100644
--- a/chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_menu_bridge_unittest.mm
@@ -10,6 +10,7 @@
#include "chrome/browser/cocoa/bookmark_menu_bridge.h"
#include "chrome/browser/cocoa/browser_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
class TestBookmarkMenuBridge : public BookmarkMenuBridge {
@@ -113,7 +114,7 @@ TEST_F(BookmarkMenuBridgeTest, TestClearBookmarkMenu) {
// submenus removed, and all separator items are gone.
EXPECT_EQ(2, [menu numberOfItems]);
for (NSMenuItem *item in [menu itemArray]) {
- EXPECT_FALSE([[item title] isEqual:@"not"]);
+ EXPECT_NSNE(@"not", [item title]);
}
}
@@ -203,7 +204,7 @@ TEST_F(BookmarkMenuBridgeTest, TestAddNodeToMenu) {
// Make sure a short title looks fine
NSString* s = [short_item title];
- EXPECT_TRUE([s isEqual:[NSString stringWithUTF8String:short_url]]);
+ EXPECT_NSEQ([NSString stringWithUTF8String:short_url], s);
// Make sure a super-long title gets trimmed
s = [long_item title];
@@ -271,7 +272,7 @@ TEST_F(BookmarkMenuBridgeTest, TestAddNodeToOther) {
EXPECT_TRUE(other);
EXPECT_TRUE([other hasSubmenu]);
ASSERT_GT([[other submenu] numberOfItems], 0);
- EXPECT_TRUE([[[[other submenu] itemAtIndex:0] title] isEqual:@"http://foo/"]);
+ EXPECT_NSEQ(@"http://foo/", [[[other submenu] itemAtIndex:0] title]);
}
TEST_F(BookmarkMenuBridgeTest, TestFavIconLoading) {
diff --git a/chrome/browser/cocoa/bookmark_name_folder_controller_unittest.mm b/chrome/browser/cocoa/bookmark_name_folder_controller_unittest.mm
index 5b3e3b5..56654a1 100644
--- a/chrome/browser/cocoa/bookmark_name_folder_controller_unittest.mm
+++ b/chrome/browser/cocoa/bookmark_name_folder_controller_unittest.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/cocoa/browser_test_helper.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
class BookmarkNameFolderControllerTest : public CocoaTest {
@@ -133,7 +134,7 @@ TEST_F(BookmarkNameFolderControllerTest, Rename) {
node:folder]);
[controller window]; // force nib load
- EXPECT_TRUE([[controller folderName] isEqual:@"group"]);
+ EXPECT_NSEQ(@"group", [controller folderName]);
[controller setFolderName:@"Zobo"];
[controller ok:nil];
EXPECT_EQ(1, parent->GetChildCount());
diff --git a/chrome/browser/cocoa/browser_accessibility_unittest.mm b/chrome/browser/cocoa/browser_accessibility_unittest.mm
index a44942e..f147f74 100644
--- a/chrome/browser/cocoa/browser_accessibility_unittest.mm
+++ b/chrome/browser/cocoa/browser_accessibility_unittest.mm
@@ -8,6 +8,7 @@
#include "chrome/browser/cocoa/browser_accessibility.h"
#include "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
@interface MockAccessibilityDelegate : NSObject<BrowserAccessibilityDelegate>
@@ -79,18 +80,16 @@ class BrowserAccessibilityTest : public CocoaTest {
TEST_F(BrowserAccessibilityTest, HitTestTest) {
BrowserAccessibility* firstChild =
[accessibility_ accessibilityHitTest:NSMakePoint(50, 50)];
- EXPECT_TRUE(
- [[firstChild accessibilityAttributeValue:NSAccessibilityTitleAttribute]
- isEqualToString:@"Child1"]);
+ EXPECT_NSEQ(@"Child1",
+ [firstChild accessibilityAttributeValue:NSAccessibilityTitleAttribute]);
}
// Test doing a hit test on the edge of a child.
TEST_F(BrowserAccessibilityTest, EdgeHitTest) {
BrowserAccessibility* firstChild =
[accessibility_ accessibilityHitTest:NSMakePoint(0, 0)];
- EXPECT_TRUE(
- [[firstChild accessibilityAttributeValue:NSAccessibilityTitleAttribute]
- isEqualToString:@"Child1"]);
+ EXPECT_NSEQ(@"Child1",
+ [firstChild accessibilityAttributeValue:NSAccessibilityTitleAttribute]);
}
// This will test a hit test with invalid coordinates. It is assumed that
@@ -99,14 +98,14 @@ TEST_F(BrowserAccessibilityTest, EdgeHitTest) {
TEST_F(BrowserAccessibilityTest, InvalidHitTestCoordsTest) {
BrowserAccessibility* hitTestResult =
[accessibility_ accessibilityHitTest:NSMakePoint(-50, 50)];
- EXPECT_TRUE([accessibility_ isEqualTo:hitTestResult]);
+ EXPECT_NSEQ(accessibility_, hitTestResult);
}
// Test to ensure querying standard attributes works.
TEST_F(BrowserAccessibilityTest, BasicAttributeTest) {
NSString* helpText = [accessibility_
accessibilityAttributeValue:NSAccessibilityHelpAttribute];
- EXPECT_TRUE([helpText isEqualToString: @"HelpText"]);
+ EXPECT_NSEQ(@"HelpText", helpText);
}
// Test querying for an invalid attribute to ensure it doesn't crash.
diff --git a/chrome/browser/cocoa/bubble_view_unittest.mm b/chrome/browser/cocoa/bubble_view_unittest.mm
index d4179af..3b3bf77 100644
--- a/chrome/browser/cocoa/bubble_view_unittest.mm
+++ b/chrome/browser/cocoa/bubble_view_unittest.mm
@@ -6,6 +6,7 @@
#include "base/scoped_nsobject.h"
#import "chrome/browser/cocoa/bubble_view.h"
#include "chrome/browser/cocoa/cocoa_test_helper.h"
+#import "testing/gtest_mac.h"
class BubbleViewTest : public CocoaTest {
public:
@@ -37,10 +38,10 @@ TEST_F(BubbleViewTest, SetContent) {
[view_ setContent:nil];
EXPECT_TRUE([view_ content] == nil);
[view_ setContent:@""];
- EXPECT_TRUE([[view_ content] isEqualToString:@""]);
+ EXPECT_NSEQ(@"", [view_ content]);
NSString* str = @"This is a really really long string that's just too long";
[view_ setContent:str];
- EXPECT_TRUE([[view_ content] isEqualToString:str]);
+ EXPECT_NSEQ(str, [view_ content]);
}
TEST_F(BubbleViewTest, CornerFlags) {
diff --git a/chrome/browser/cocoa/bug_report_window_controller_unittest.mm b/chrome/browser/cocoa/bug_report_window_controller_unittest.mm
index 941327f..cf8d3ac 100644
--- a/chrome/browser/cocoa/bug_report_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/bug_report_window_controller_unittest.mm
@@ -10,6 +10,7 @@
#include "chrome/browser/renderer_host/test/test_render_view_host.h"
#include "chrome/browser/tab_contents/test_tab_contents.h"
#include "chrome/browser/profile.h"
+#import "testing/gtest_mac.h"
namespace {
@@ -39,8 +40,8 @@ TEST_F(BugReportWindowControllerUnittest, DISABLED_ReportBugWithNewTabPageOpen)
EXPECT_FALSE([controller isPhishingReport]);
// Make sure that the tab was correctly recorded.
- EXPECT_TRUE([[controller pageURL] isEqualToString:@"chrome://newtab/"]);
- EXPECT_TRUE([[controller pageTitle] isEqualToString:@"New Tab"]);
+ EXPECT_NSEQ(@"chrome://newtab/", [controller pageURL]);
+ EXPECT_NSEQ(@"New Tab", [controller pageTitle]);
// When we call "report bug" with non-empty tab contents, all menu options
// should be available, and we should send screenshot by default.
diff --git a/chrome/browser/cocoa/chrome_browser_window_unittest.mm b/chrome/browser/cocoa/chrome_browser_window_unittest.mm
index 4ab4a2a..f9cd4dc 100644
--- a/chrome/browser/cocoa/chrome_browser_window_unittest.mm
+++ b/chrome/browser/cocoa/chrome_browser_window_unittest.mm
@@ -11,6 +11,7 @@
#import "chrome/browser/cocoa/browser_frame_view.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
@@ -168,7 +169,7 @@ TEST_F(ChromeBrowserWindowTest, WindowWidgetTrackingArea) {
NSRect rect = [area rect];
foundArea = NSPointInRect(point, rect);
if (foundArea) {
- EXPECT_TRUE([[area owner] isEqual:frameView]);
+ EXPECT_NSEQ(frameView, [area owner]);
break;
}
}
diff --git a/chrome/browser/cocoa/cookie_details_unittest.mm b/chrome/browser/cocoa/cookie_details_unittest.mm
index 9883a6a..fa79c31 100644
--- a/chrome/browser/cocoa/cookie_details_unittest.mm
+++ b/chrome/browser/cocoa/cookie_details_unittest.mm
@@ -6,6 +6,7 @@
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "chrome/browser/cocoa/cookie_details.h"
#include "googleurl/src/gurl.h"
+#import "testing/gtest_mac.h"
namespace {
@@ -32,14 +33,14 @@ TEST_F(CookiesDetailsTest, CreateForCookie) {
canEditExpiration:NO]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeCookie);
- EXPECT_TRUE([@"PHPSESSID" isEqualToString:[details.get() name]]);
- EXPECT_TRUE([@"0123456789abcdef0123456789abcdef"
- isEqualToString:[details.get() content]]);
- EXPECT_TRUE([@"http://chromium.org" isEqualToString:[details.get() domain]]);
- EXPECT_TRUE([@"/" isEqualToString:[details.get() path]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() lastModified]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() created]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() sendFor]]);
+ EXPECT_NSEQ(@"PHPSESSID", [details.get() name]);
+ EXPECT_NSEQ(@"0123456789abcdef0123456789abcdef",
+ [details.get() content]);
+ EXPECT_NSEQ(@"http://chromium.org", [details.get() domain]);
+ EXPECT_NSEQ(@"/", [details.get() path]);
+ EXPECT_NSNE(@"", [details.get() lastModified]);
+ EXPECT_NSNE(@"", [details.get() created]);
+ EXPECT_NSNE(@"", [details.get() sendFor]);
EXPECT_FALSE([details.get() shouldHideCookieDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
@@ -63,10 +64,9 @@ TEST_F(CookiesDetailsTest, CreateForTreeDatabase) {
details.reset([[CocoaCookieDetails alloc] initWithDatabase:&info]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeDatabase);
- EXPECT_TRUE([@"a great place to climb" isEqualToString:[details.get()
- databaseDescription]]);
- EXPECT_TRUE([@"1234 B" isEqualToString:[details.get() fileSize]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() lastModified]]);
+ EXPECT_NSEQ(@"a great place to climb", [details.get() databaseDescription]);
+ EXPECT_NSEQ(@"1234 B", [details.get() fileSize]);
+ EXPECT_NSNE(@"", [details.get() lastModified]);
EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
@@ -92,9 +92,9 @@ TEST_F(CookiesDetailsTest, CreateForTreeLocalStorage) {
details.reset([[CocoaCookieDetails alloc] initWithLocalStorage:&info]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeLocalStorage);
- EXPECT_TRUE([@"chromium.org" isEqualToString:[details.get() domain]]);
- EXPECT_TRUE([@"1234 B" isEqualToString:[details.get() fileSize]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() lastModified]]);
+ EXPECT_NSEQ(@"chromium.org", [details.get() domain]);
+ EXPECT_NSEQ(@"1234 B", [details.get() fileSize]);
+ EXPECT_NSNE(@"", [details.get() lastModified]);
EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
EXPECT_TRUE([details.get() shouldShowLocalStorageTreeDetailsView]);
@@ -118,11 +118,11 @@ TEST_F(CookiesDetailsTest, CreateForTreeAppCache) {
details.reset([[CocoaCookieDetails alloc] initWithAppCacheInfo:&info]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypeTreeAppCache);
- EXPECT_TRUE([@"http://chromium.org/stuff.manifest"
- isEqualToString:[details.get() manifestURL]]);
- EXPECT_TRUE([@"2678 B" isEqualToString:[details.get() fileSize]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() lastAccessed]]);
- EXPECT_FALSE([@"" isEqualToString:[details.get() created]]);
+ EXPECT_NSEQ(@"http://chromium.org/stuff.manifest",
+ [details.get() manifestURL]);
+ EXPECT_NSEQ(@"2678 B", [details.get() fileSize]);
+ EXPECT_NSNE(@"", [details.get() lastAccessed]);
+ EXPECT_NSNE(@"", [details.get() created]);
EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
@@ -144,10 +144,10 @@ TEST_F(CookiesDetailsTest, CreateForPromptDatabase) {
fileSize:94]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypePromptDatabase);
- EXPECT_TRUE([@"chromium.org" isEqualToString:[details.get() domain]]);
- EXPECT_TRUE([@"wicked_name" isEqualToString:[details.get() name]]);
- EXPECT_TRUE([@"desc" isEqualToString:[details.get() databaseDescription]]);
- EXPECT_TRUE([@"94 B" isEqualToString:[details.get() fileSize]]);
+ EXPECT_NSEQ(@"chromium.org", [details.get() domain]);
+ EXPECT_NSEQ(@"wicked_name", [details.get() name]);
+ EXPECT_NSEQ(@"desc", [details.get() databaseDescription]);
+ EXPECT_NSEQ(@"94 B", [details.get() fileSize]);
EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
@@ -168,9 +168,9 @@ TEST_F(CookiesDetailsTest, CreateForPromptLocalStorage) {
value:value]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypePromptLocalStorage);
- EXPECT_TRUE([@"chromium.org" isEqualToString:[details.get() domain]]);
- EXPECT_TRUE([@"testKey" isEqualToString:[details.get() localStorageKey]]);
- EXPECT_TRUE([@"testValue" isEqualToString:[details.get() localStorageValue]]);
+ EXPECT_NSEQ(@"chromium.org", [details.get() domain]);
+ EXPECT_NSEQ(@"testKey", [details.get() localStorageKey]);
+ EXPECT_NSEQ(@"testValue", [details.get() localStorageValue]);
EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
@@ -188,8 +188,8 @@ TEST_F(CookiesDetailsTest, CreateForPromptAppCache) {
initWithAppCacheManifestURL:manifestURL.c_str()]);
EXPECT_EQ([details.get() type], kCocoaCookieDetailsTypePromptAppCache);
- EXPECT_TRUE([@"http://html5demos.com/html5demo.manifest"
- isEqualToString:[details.get() manifestURL]]);
+ EXPECT_NSEQ(@"http://html5demos.com/html5demo.manifest",
+ [details.get() manifestURL]);
EXPECT_TRUE([details.get() shouldHideCookieDetailsView]);
EXPECT_FALSE([details.get() shouldShowLocalStorageTreeDetailsView]);
diff --git a/chrome/browser/cocoa/cookies_window_controller_unittest.mm b/chrome/browser/cocoa/cookies_window_controller_unittest.mm
index 48f4a0e..6abf680 100644
--- a/chrome/browser/cocoa/cookies_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/cookies_window_controller_unittest.mm
@@ -24,6 +24,7 @@
#include "grit/generated_resources.h"
#include "net/url_request/url_request_context.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
@@ -144,14 +145,14 @@ TEST_F(CookiesWindowControllerTest, CocoaNodeFromTreeNodeCookie) {
CocoaCookieTreeNode* cookie = CocoaNodeFromTreeNode(node);
CocoaCookieDetails* details = [cookie details];
- EXPECT_TRUE([@"B" isEqualToString:[details content]]);
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_COOKIE_EXPIRES_SESSION)
- isEqualToString:[details expires]]);
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_COOKIE_SENDFOR_ANY)
- isEqualToString:[details sendFor]]);
- EXPECT_TRUE([@"A" isEqualToString:[cookie title]]);
- EXPECT_TRUE([@"A" isEqualToString:[details name]]);
- EXPECT_TRUE([@"/" isEqualToString:[details path]]);
+ EXPECT_NSEQ(@"B", [details content]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_COOKIE_EXPIRES_SESSION),
+ [details expires]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_COOKIE_SENDFOR_ANY),
+ [details sendFor]);
+ EXPECT_NSEQ(@"A", [cookie title]);
+ EXPECT_NSEQ(@"A", [details name]);
+ EXPECT_NSEQ(@"/", [details path]);
EXPECT_EQ(0U, [[cookie children] count]);
EXPECT_TRUE([details created]);
EXPECT_TRUE([cookie isLeaf]);
@@ -170,30 +171,29 @@ TEST_F(CookiesWindowControllerTest, CocoaNodeFromTreeNodeRecursive) {
CocoaCookieTreeNode* cookie = [[cookies children] objectAtIndex:0];
// Test domain-level node.
- EXPECT_TRUE([@"foo.com" isEqualToString:[domain title]]);
+ EXPECT_NSEQ(@"foo.com", [domain title]);
EXPECT_FALSE([domain isLeaf]);
EXPECT_EQ(1U, [[domain children] count]);
EXPECT_EQ(node, [domain treeNode]);
// Test "Cookies" folder node.
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_COOKIES) isEqualToString:
- [cookies title]]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_COOKIES), [cookies title]);
EXPECT_FALSE([cookies isLeaf]);
EXPECT_EQ(1U, [[cookies children] count]);
EXPECT_EQ(node->GetChild(0), [cookies treeNode]);
// Test cookie node. This is the same as CocoaNodeFromTreeNodeCookie.
CocoaCookieDetails* details = [cookie details];
- EXPECT_TRUE([@"B" isEqualToString:[details content]]);
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_COOKIE_EXPIRES_SESSION)
- isEqualToString:[details expires]]);
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_COOKIE_SENDFOR_ANY)
- isEqualToString:[details sendFor]]);
- EXPECT_TRUE([@"A" isEqualToString:[cookie title]]);
- EXPECT_TRUE([@"A" isEqualToString:[details name]]);
- EXPECT_TRUE([@"/" isEqualToString:[details path]]);
- EXPECT_TRUE([@"foo.com" isEqualToString:[details domain]]);
+ EXPECT_NSEQ(@"B", [details content]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_COOKIE_EXPIRES_SESSION),
+ [details expires]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_COOKIE_SENDFOR_ANY),
+ [details sendFor]);
+ EXPECT_NSEQ(@"A", [cookie title]);
+ EXPECT_NSEQ(@"A", [details name]);
+ EXPECT_NSEQ(@"/", [details path]);
+ EXPECT_NSEQ(@"foo.com", [details domain]);
EXPECT_EQ(0U, [[cookie children] count]);
EXPECT_TRUE([details created]);
EXPECT_TRUE([cookie isLeaf]);
@@ -272,7 +272,7 @@ TEST_F(CookiesWindowControllerTest, TreeNodesRemoved) {
EXPECT_EQ(1U, [cocoa_children count]);
NSString* title = [[[cocoa_children objectAtIndex:0] details] name];
- EXPECT_TRUE([@"A" isEqualToString:title]);
+ EXPECT_NSEQ(@"A", title);
}
TEST_F(CookiesWindowControllerTest, TreeNodeChildrenReordered) {
@@ -297,11 +297,11 @@ TEST_F(CookiesWindowControllerTest, TreeNodeChildrenReordered) {
// Check default ordering.
CocoaCookieTreeNode* node = [cocoa_children objectAtIndex:0];
- EXPECT_TRUE([@"A" isEqualToString:[[node details] name]]);
+ EXPECT_NSEQ(@"A", [[node details] name]);
node = [cocoa_children objectAtIndex:1];
- EXPECT_TRUE([@"C" isEqualToString:[[node details] name]]);
+ EXPECT_NSEQ(@"C", [[node details] name]);
node = [cocoa_children objectAtIndex:2];
- EXPECT_TRUE([@"E" isEqualToString:[[node details] name]]);
+ EXPECT_NSEQ(@"E", [[node details] name]);
CookiesTreeModel* model = [controller_ treeModel];
// Root --> foo.com --> Cookies.
@@ -318,11 +318,11 @@ TEST_F(CookiesWindowControllerTest, TreeNodeChildrenReordered) {
// Check the new order.
node = [cocoa_children objectAtIndex:0];
- EXPECT_TRUE([@"E" isEqualToString:[[node details] name]]);
+ EXPECT_NSEQ(@"E", [[node details] name]);
node = [cocoa_children objectAtIndex:1];
- EXPECT_TRUE([@"A" isEqualToString:[[node details] name]]);
+ EXPECT_NSEQ(@"A", [[node details] name]);
node = [cocoa_children objectAtIndex:2];
- EXPECT_TRUE([@"C" isEqualToString:[[node details] name]]);
+ EXPECT_NSEQ(@"C", [[node details] name]);
}
TEST_F(CookiesWindowControllerTest, TreeNodeChanged) {
@@ -346,8 +346,8 @@ TEST_F(CookiesWindowControllerTest, TreeNodeChanged) {
[[[[[controller_ cocoaTreeModel] children] objectAtIndex:0]
children] objectAtIndex:0];
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_COOKIES) isEqualToString:
- [cocoa_node title]]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_COOKIES),
+ [cocoa_node title]);
// Fake update the cookie folder's title. This would never happen in reality,
// but it tests the code path that ultimately calls CocoaNodeFromTreeNode,
@@ -355,7 +355,7 @@ TEST_F(CookiesWindowControllerTest, TreeNodeChanged) {
node->SetTitle(L"Silly Change");
[controller_ modelObserver]->TreeNodeChanged(model, node);
- EXPECT_TRUE([@"Silly Change" isEqualToString:[cocoa_node title]]);
+ EXPECT_NSEQ(@"Silly Change", [cocoa_node title]);
}
TEST_F(CookiesWindowControllerTest, DeleteCookie) {
@@ -388,8 +388,8 @@ TEST_F(CookiesWindowControllerTest, DeleteCookie) {
NSArray* cookies = [[[[[[controller cocoaTreeModel] children]
objectAtIndex:0] children] objectAtIndex:0] children];
EXPECT_EQ(1U, [cookies count]);
- EXPECT_TRUE([@"C" isEqualToString:[[cookies lastObject] title]]);
- EXPECT_TRUE([indexPath isEqual:[treeController selectionIndexPath]]);
+ EXPECT_NSEQ(@"C", [[cookies lastObject] title]);
+ EXPECT_NSEQ(indexPath, [treeController selectionIndexPath]);
// Select cookie E.
NSUInteger pathE[3] = {1, 0, 0};
@@ -631,46 +631,44 @@ TEST_F(CookiesWindowControllerTest, CreateDatabaseStorageNodes) {
// Root --> gdbhost1.
CocoaCookieTreeNode* node =
[[[controller_ cocoaTreeModel] children] objectAtIndex:0];
- EXPECT_TRUE([@"gdbhost1" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"gdbhost1", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// host1 --> Web Databases.
node = [[node children] lastObject];
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_WEB_DATABASES)
- isEqualToString:[node title]]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_WEB_DATABASES), [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// Database Storage --> db1.
node = [[node children] lastObject];
- EXPECT_TRUE([@"db1" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"db1", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeTreeDatabase, [node nodeType]);
CocoaCookieDetails* details = [node details];
- EXPECT_TRUE([@"description 1" isEqualToString:[details databaseDescription]]);
+ EXPECT_NSEQ(@"description 1", [details databaseDescription]);
EXPECT_TRUE([details lastModified]);
EXPECT_TRUE([details fileSize]);
// Root --> gdbhost2.
node =
[[[controller_ cocoaTreeModel] children] objectAtIndex:1];
- EXPECT_TRUE([@"gdbhost2" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"gdbhost2", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// host1 --> Web Databases.
node = [[node children] lastObject];
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_WEB_DATABASES)
- isEqualToString:[node title]]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_WEB_DATABASES), [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// Database Storage --> db2.
node = [[node children] lastObject];
- EXPECT_TRUE([@"db2" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"db2", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeTreeDatabase, [node nodeType]);
details = [node details];
- EXPECT_TRUE([@"description 2" isEqualToString:[details databaseDescription]]);
+ EXPECT_NSEQ(@"description 2", [details databaseDescription]);
EXPECT_TRUE([details lastModified]);
EXPECT_TRUE([details fileSize]);
}
@@ -695,44 +693,42 @@ TEST_F(CookiesWindowControllerTest, CreateLocalStorageNodes) {
// Root --> host1.
CocoaCookieTreeNode* node =
[[[controller_ cocoaTreeModel] children] objectAtIndex:2];
- EXPECT_TRUE([@"host1" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"host1", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// host1 --> Local Storage.
node = [[node children] lastObject];
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_LOCAL_STORAGE)
- isEqualToString:[node title]]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_LOCAL_STORAGE), [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// Local Storage --> http://host1:1/.
node = [[node children] lastObject];
- EXPECT_TRUE([@"http://host1:1/" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"http://host1:1/", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeTreeLocalStorage, [node nodeType]);
- EXPECT_TRUE([@"http://host1:1/" isEqualToString:[[node details] domain]]);
+ EXPECT_NSEQ(@"http://host1:1/", [[node details] domain]);
EXPECT_TRUE([[node details] lastModified]);
EXPECT_TRUE([[node details] fileSize]);
// Root --> host2.
node =
[[[controller_ cocoaTreeModel] children] objectAtIndex:3];
- EXPECT_TRUE([@"host2" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"host2", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// host2 --> Local Storage.
node = [[node children] lastObject];
- EXPECT_TRUE([l10n_util::GetNSString(IDS_COOKIES_LOCAL_STORAGE)
- isEqualToString:[node title]]);
+ EXPECT_NSEQ(l10n_util::GetNSString(IDS_COOKIES_LOCAL_STORAGE), [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeFolder, [node nodeType]);
EXPECT_EQ(1U, [[node children] count]);
// Local Storage --> http://host2:2/.
node = [[node children] lastObject];
- EXPECT_TRUE([@"http://host2:2/" isEqualToString:[node title]]);
+ EXPECT_NSEQ(@"http://host2:2/", [node title]);
EXPECT_EQ(kCocoaCookieDetailsTypeTreeLocalStorage, [node nodeType]);
- EXPECT_TRUE([@"http://host2:2/" isEqualToString:[[node details] domain]]);
+ EXPECT_NSEQ(@"http://host2:2/", [[node details] domain]);
EXPECT_TRUE([[node details] lastModified]);
EXPECT_TRUE([[node details] fileSize]);
}
diff --git a/chrome/browser/cocoa/custom_home_pages_model_unittest.mm b/chrome/browser/cocoa/custom_home_pages_model_unittest.mm
index addb0e0..fb9b3be 100644
--- a/chrome/browser/cocoa/custom_home_pages_model_unittest.mm
+++ b/chrome/browser/cocoa/custom_home_pages_model_unittest.mm
@@ -7,6 +7,7 @@
#import "chrome/browser/cocoa/custom_home_pages_model.h"
#include "chrome/browser/session_startup_pref.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// A helper for KVO and NSNotifications. Makes a note that it's been called
@@ -132,17 +133,17 @@ TEST_F(CustomHomePagesModelTest, KVO) {
inCustomHomePagesAtIndex:2];
EXPECT_EQ([model_ countOfCustomHomePages], 3U);
- EXPECT_TRUE([EntryURL([model_ objectInCustomHomePagesAtIndex:1])
- isEqualToString:@"http://www.yahoo.com/"]);
+ EXPECT_NSEQ(@"http://www.yahoo.com/",
+ EntryURL([model_ objectInCustomHomePagesAtIndex:1]));
kvo_helper.get()->sawNotification_ = NO;
[model_ removeObjectFromCustomHomePagesAtIndex:1];
EXPECT_TRUE(kvo_helper.get()->sawNotification_);
EXPECT_EQ([model_ countOfCustomHomePages], 2U);
- EXPECT_TRUE([EntryURL([model_ objectInCustomHomePagesAtIndex:1])
- isEqualToString:@"http://dev.chromium.org/"]);
- EXPECT_TRUE([EntryURL([model_ objectInCustomHomePagesAtIndex:0])
- isEqualToString:@"http://www.google.com/"]);
+ EXPECT_NSEQ(@"http://dev.chromium.org/",
+ EntryURL([model_ objectInCustomHomePagesAtIndex:1]));
+ EXPECT_NSEQ(@"http://www.google.com/",
+ EntryURL([model_ objectInCustomHomePagesAtIndex:0]));
[model_ removeObserver:kvo_helper forKeyPath:@"customHomePages"];
}
@@ -186,8 +187,8 @@ TEST_F(CustomHomePagesModelTest, ReloadURLs) {
EXPECT_TRUE(kvo_helper.get()->sawNotification_);
EXPECT_EQ([model_ countOfCustomHomePages], 1U);
- EXPECT_TRUE([EntryURL([model_ objectInCustomHomePagesAtIndex:0])
- isEqualToString:@"http://www.google.com/"]);
+ EXPECT_NSEQ(@"http://www.google.com/",
+ EntryURL([model_ objectInCustomHomePagesAtIndex:0]));
[model_ removeObserver:kvo_helper.get() forKeyPath:@"customHomePages"];
}
diff --git a/chrome/browser/cocoa/download_util_mac_unittest.mm b/chrome/browser/cocoa/download_util_mac_unittest.mm
index 3fb98d2..88d6097 100644
--- a/chrome/browser/cocoa/download_util_mac_unittest.mm
+++ b/chrome/browser/cocoa/download_util_mac_unittest.mm
@@ -10,6 +10,7 @@
#import "chrome/browser/cocoa/download_util_mac.h"
#include "chrome/common/chrome_paths.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
namespace {
@@ -51,7 +52,7 @@ TEST_F(DownloadUtilMacTest, AddFileToPasteboardTest) {
ASSERT_TRUE(files != nil);
NSString* expectedPath = [files objectAtIndex:0];
NSString* realPath = base::SysWideToNSString(testPath.ToWStringHack());
- EXPECT_TRUE([expectedPath isEqualToString:realPath]);
+ EXPECT_NSEQ(expectedPath, realPath);
}
} // namespace
diff --git a/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm b/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm
index e38c022..50e7259 100644
--- a/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm
+++ b/chrome/browser/cocoa/edit_search_engine_cocoa_controller_unittest.mm
@@ -11,6 +11,7 @@
#include "chrome/test/testing_profile.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
@interface FakeEditSearchEngineController : EditSearchEngineCocoaController {
@@ -83,7 +84,7 @@ TEST_F(EditSearchEngineControllerTest, ValidImageOriginals) {
// Test window title is set correctly.
NSString* title = l10n_util::GetNSString(
IDS_SEARCH_ENGINES_EDITOR_NEW_WINDOW_TITLE);
- EXPECT_TRUE([title isEqualToString:[[controller_ window] title]]);
+ EXPECT_NSEQ(title, [[controller_ window] title]);
}
TEST_F(EditSearchEngineControllerTest, SetImageViews) {
@@ -101,23 +102,23 @@ TEST_F(EditSearchEngineControllerTest, InvalidState) {
NSString* toolTip = nil;
EXPECT_FALSE([controller_ validateFields]);
- EXPECT_TRUE([@"" isEqualToString:[[controller_ nameField] stringValue]]);
+ EXPECT_NSEQ(@"", [[controller_ nameField] stringValue]);
EXPECT_EQ([controller_ badImage], [[controller_ nameImage] image]);
toolTip = l10n_util::GetNSString(IDS_SEARCH_ENGINES_INVALID_TITLE_TT);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ nameField] toolTip]]);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ nameImage] toolTip]]);
+ EXPECT_NSEQ(toolTip, [[controller_ nameField] toolTip]);
+ EXPECT_NSEQ(toolTip, [[controller_ nameImage] toolTip]);
// Keywords can not be empty strings.
- EXPECT_TRUE([@"" isEqualToString:[[controller_ keywordField] stringValue]]);
+ EXPECT_NSEQ(@"", [[controller_ keywordField] stringValue]);
EXPECT_EQ([controller_ badImage], [[controller_ keywordImage] image]);
EXPECT_TRUE([[controller_ keywordField] toolTip]);
EXPECT_TRUE([[controller_ keywordImage] toolTip]);
- EXPECT_TRUE([@"" isEqualToString:[[controller_ urlField] stringValue]]);
+ EXPECT_NSEQ(@"", [[controller_ urlField] stringValue]);
EXPECT_EQ([controller_ badImage], [[controller_ urlImage] image]);
toolTip = l10n_util::GetNSString(IDS_SEARCH_ENGINES_INVALID_URL_TT);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ urlField] toolTip]]);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ urlImage] toolTip]]);
+ EXPECT_NSEQ(toolTip, [[controller_ urlField] toolTip]);
+ EXPECT_NSEQ(toolTip, [[controller_ urlImage] toolTip]);
}
// Tests that the single name field validates.
@@ -128,8 +129,8 @@ TEST_F(EditSearchEngineControllerTest, ValidateName) {
EXPECT_FALSE([controller_ validateFields]);
NSString* toolTip =
l10n_util::GetNSString(IDS_SEARCH_ENGINES_INVALID_TITLE_TT);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ nameField] toolTip]]);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ nameImage] toolTip]]);
+ EXPECT_NSEQ(toolTip, [[controller_ nameField] toolTip]);
+ EXPECT_NSEQ(toolTip, [[controller_ nameImage] toolTip]);
[[controller_ nameField] setStringValue:@"Test Name"];
EXPECT_FALSE([controller_ validateFields]);
EXPECT_EQ([controller_ goodImage], [[controller_ nameImage] image]);
@@ -162,8 +163,8 @@ TEST_F(EditSearchEngineControllerTest, ValidateURL) {
EXPECT_FALSE([controller_ validateFields]);
NSString* toolTip =
l10n_util::GetNSString(IDS_SEARCH_ENGINES_INVALID_URL_TT);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ urlField] toolTip]]);
- EXPECT_TRUE([toolTip isEqualToString:[[controller_ urlImage] toolTip]]);
+ EXPECT_NSEQ(toolTip, [[controller_ urlField] toolTip]);
+ EXPECT_NSEQ(toolTip, [[controller_ urlImage] toolTip]);
[[controller_ urlField] setStringValue:@"http://foo-bar.com"];
EXPECT_FALSE([controller_ validateFields]);
EXPECT_EQ([controller_ goodImage], [[controller_ urlImage] image]);
@@ -217,13 +218,13 @@ TEST_F(EditSearchEngineControllerTest, EditTemplateURL) {
EXPECT_TRUE([controller window]);
NSString* title = l10n_util::GetNSString(
IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE);
- EXPECT_TRUE([title isEqualToString:[[controller window] title]]);
+ EXPECT_NSEQ(title, [[controller window] title]);
NSString* nameString = [[controller nameField] stringValue];
- EXPECT_TRUE([@"Foobar" isEqualToString:nameString]);
+ EXPECT_NSEQ(@"Foobar", nameString);
NSString* keywordString = [[controller keywordField] stringValue];
- EXPECT_TRUE([@"keyword" isEqualToString:keywordString]);
+ EXPECT_NSEQ(@"keyword", keywordString);
NSString* urlValueString = [[controller urlField] stringValue];
- EXPECT_TRUE([@"http://foo-bar.com" isEqualToString:urlValueString]);
+ EXPECT_NSEQ(@"http://foo-bar.com", urlValueString);
EXPECT_TRUE([controller validateFields]);
[controller close];
}
diff --git a/chrome/browser/cocoa/extensions/extension_install_prompt_controller_unittest.mm b/chrome/browser/cocoa/extensions/extension_install_prompt_controller_unittest.mm
index aa1e586..3ad12db 100644
--- a/chrome/browser/cocoa/extensions/extension_install_prompt_controller_unittest.mm
+++ b/chrome/browser/cocoa/extensions/extension_install_prompt_controller_unittest.mm
@@ -18,6 +18,7 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/json_value_serializer.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/glue/image_decoder.h"
@@ -128,7 +129,7 @@ TEST_F(ExtensionInstallPromptControllerTest, BasicsNormalCancel) {
[controller window]; // force nib load
// Test the right nib loaded.
- EXPECT_TRUE([[controller windowNibName] isEqual:@"ExtensionInstallPrompt"]);
+ EXPECT_NSEQ(@"ExtensionInstallPrompt", [controller windowNibName]);
// Check all the controls.
// Make sure everything is non-nil, and that the fields that are
@@ -145,8 +146,8 @@ TEST_F(ExtensionInstallPromptControllerTest, BasicsNormalCancel) {
EXPECT_NE('^', [[[controller subtitleField] stringValue] characterAtIndex:0]);
EXPECT_TRUE([controller warningsField] != nil);
- EXPECT_TRUE([[[controller warningsField] stringValue]
- isEqual:(base::SysUTF16ToNSString(warnings[0]))]);
+ EXPECT_NSEQ([[controller warningsField] stringValue],
+ base::SysUTF16ToNSString(warnings[0]));
EXPECT_TRUE([controller warningsBox] != nil);
@@ -270,8 +271,7 @@ TEST_F(ExtensionInstallPromptControllerTest, BasicsSkinny) {
[controller window]; // force nib load
// Test the right nib loaded.
- EXPECT_TRUE([[controller windowNibName]
- isEqual:@"ExtensionInstallPromptNoWarnings"]);
+ EXPECT_NSEQ(@"ExtensionInstallPromptNoWarnings", [controller windowNibName]);
// Check all the controls.
// In the skinny prompt, only the icon, title and buttons are non-nill.
diff --git a/chrome/browser/cocoa/font_language_settings_controller_unittest.mm b/chrome/browser/cocoa/font_language_settings_controller_unittest.mm
index 59d41bb..075d495 100644
--- a/chrome/browser/cocoa/font_language_settings_controller_unittest.mm
+++ b/chrome/browser/cocoa/font_language_settings_controller_unittest.mm
@@ -9,6 +9,7 @@
#import "chrome/browser/cocoa/font_language_settings_controller.h"
#include "chrome/browser/profile.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// The FontLanguageSettingsControllerForTest overrides the getFontFieldOrigin
@@ -66,8 +67,8 @@ TEST_F(FontLanguageSettingsControllerTest, UpdateDisplayField) {
withFont:font
withLabel:label];
- ASSERT_TRUE([[font fontName] isEqualToString:[[field font] fontName]]);
- ASSERT_TRUE([@"Times-Roman, 12" isEqualToString:[field stringValue]]);
+ ASSERT_NSEQ([font fontName], [[field font] fontName]);
+ ASSERT_NSEQ(@"Times-Roman, 12", [field stringValue]);
}
TEST_F(FontLanguageSettingsControllerTest, UpdateDisplayFieldNilFont) {
@@ -80,7 +81,7 @@ TEST_F(FontLanguageSettingsControllerTest, UpdateDisplayFieldNilFont) {
withFont:nil
withLabel:label];
- ASSERT_TRUE([@"foo" isEqualToString:[field stringValue]]);
+ ASSERT_NSEQ(@"foo", [field stringValue]);
}
TEST_F(FontLanguageSettingsControllerTest, UpdateDisplayFieldNilField) {
diff --git a/chrome/browser/cocoa/history_menu_bridge_unittest.mm b/chrome/browser/cocoa/history_menu_bridge_unittest.mm
index 1fd47a2..456da45 100644
--- a/chrome/browser/cocoa/history_menu_bridge_unittest.mm
+++ b/chrome/browser/cocoa/history_menu_bridge_unittest.mm
@@ -18,6 +18,7 @@
#include "gfx/codec/png_codec.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
namespace {
@@ -132,8 +133,8 @@ TEST_F(HistoryMenuBridgeTest, ClearHistoryMenuUntilEnd) {
ClearMenuSection(menu, HistoryMenuBridge::kMostVisited);
EXPECT_EQ(1, [menu numberOfItems]);
- EXPECT_TRUE([@"HEADER" isEqualToString:
- [[menu itemWithTag:HistoryMenuBridge::kMostVisitedTitle] title]]);
+ EXPECT_NSEQ(@"HEADER",
+ [[menu itemWithTag:HistoryMenuBridge::kMostVisitedTitle] title]);
}
// Skip menu items that are not hooked up to |-openHistoryMenuItem:|.
@@ -150,10 +151,10 @@ TEST_F(HistoryMenuBridgeTest, ClearHistoryMenuSkipping) {
ClearMenuSection(menu, tag);
EXPECT_EQ(2, [menu numberOfItems]);
- EXPECT_TRUE([@"HEADER" isEqualToString:
- [[menu itemWithTag:HistoryMenuBridge::kMostVisitedTitle] title]]);
- EXPECT_TRUE([@"TITLE" isEqualToString:
- [[menu itemAtIndex:1] title]]);
+ EXPECT_NSEQ(@"HEADER",
+ [[menu itemWithTag:HistoryMenuBridge::kMostVisitedTitle] title]);
+ EXPECT_NSEQ(@"TITLE",
+ [[menu itemAtIndex:1] title]);
}
// Edge case test for clearing an empty menu.
@@ -164,8 +165,8 @@ TEST_F(HistoryMenuBridgeTest, ClearHistoryMenuEmpty) {
ClearMenuSection(menu, HistoryMenuBridge::kMostVisited);
EXPECT_EQ(1, [menu numberOfItems]);
- EXPECT_TRUE([@"HEADER" isEqualToString:
- [[menu itemWithTag:HistoryMenuBridge::kMostVisited] title]]);
+ EXPECT_NSEQ(@"HEADER",
+ [[menu itemWithTag:HistoryMenuBridge::kMostVisited] title]);
}
// Test that AddItemToMenu() properly adds HistoryItem objects as menus.
@@ -236,13 +237,13 @@ TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabs) {
MockBridge::HistoryItem* hist1 = bridge_->HistoryItemForMenuItem(item1);
EXPECT_TRUE(hist1);
EXPECT_EQ(24, hist1->session_id);
- EXPECT_TRUE([@"Google" isEqualToString:[item1 title]]);
+ EXPECT_NSEQ(@"Google", [item1 title]);
NSMenuItem* item2 = [menu itemAtIndex:1];
MockBridge::HistoryItem* hist2 = bridge_->HistoryItemForMenuItem(item2);
EXPECT_TRUE(hist2);
EXPECT_EQ(42, hist2->session_id);
- EXPECT_TRUE([@"Apple" isEqualToString:[item2 title]]);
+ EXPECT_NSEQ(@"Apple", [item2 title]);
}
// Test that the menu is created for a mix of windows and tabs.
@@ -296,7 +297,7 @@ TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabsAndWindows) {
MockBridge::HistoryItem* hist1 = bridge_->HistoryItemForMenuItem(item1);
EXPECT_TRUE(hist1);
EXPECT_EQ(24, hist1->session_id);
- EXPECT_TRUE([@"Google" isEqualToString:[item1 title]]);
+ EXPECT_NSEQ(@"Google", [item1 title]);
NSMenuItem* item2 = [menu itemAtIndex:1];
MockBridge::HistoryItem* hist2 = bridge_->HistoryItemForMenuItem(item2);
@@ -308,14 +309,14 @@ TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabsAndWindows) {
EXPECT_EQ(4U, [[submenu1 itemArray] count]);
// Do not test Restore All Tabs because it is localiced.
EXPECT_TRUE([[submenu1 itemAtIndex:1] isSeparatorItem]);
- EXPECT_TRUE([@"foo" isEqualToString:[[submenu1 itemAtIndex:2] title]]);
- EXPECT_TRUE([@"bar" isEqualToString:[[submenu1 itemAtIndex:3] title]]);
+ EXPECT_NSEQ(@"foo", [[submenu1 itemAtIndex:2] title]);
+ EXPECT_NSEQ(@"bar", [[submenu1 itemAtIndex:3] title]);
NSMenuItem* item3 = [menu itemAtIndex:2];
MockBridge::HistoryItem* hist3 = bridge_->HistoryItemForMenuItem(item3);
EXPECT_TRUE(hist3);
EXPECT_EQ(42, hist3->session_id);
- EXPECT_TRUE([@"Apple" isEqualToString:[item3 title]]);
+ EXPECT_NSEQ(@"Apple", [item3 title]);
NSMenuItem* item4 = [menu itemAtIndex:3];
MockBridge::HistoryItem* hist4 = bridge_->HistoryItemForMenuItem(item4);
@@ -327,9 +328,9 @@ TEST_F(HistoryMenuBridgeTest, RecentlyClosedTabsAndWindows) {
EXPECT_EQ(5U, [[submenu2 itemArray] count]);
// Do not test Restore All Tabs because it is localiced.
EXPECT_TRUE([[submenu2 itemAtIndex:1] isSeparatorItem]);
- EXPECT_TRUE([@"magic" isEqualToString:[[submenu2 itemAtIndex:2] title]]);
- EXPECT_TRUE([@"goats" isEqualToString:[[submenu2 itemAtIndex:3] title]]);
- EXPECT_TRUE([@"teleporter" isEqualToString:[[submenu2 itemAtIndex:4] title]]);
+ EXPECT_NSEQ(@"magic", [[submenu2 itemAtIndex:2] title]);
+ EXPECT_NSEQ(@"goats", [[submenu2 itemAtIndex:3] title]);
+ EXPECT_NSEQ(@"teleporter", [[submenu2 itemAtIndex:4] title]);
}
// Tests that we properly request an icon from the FaviconService.
diff --git a/chrome/browser/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm b/chrome/browser/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
index 543d4fa..8d5cecf 100644
--- a/chrome/browser/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
+++ b/chrome/browser/cocoa/location_bar/autocomplete_text_field_editor_unittest.mm
@@ -14,6 +14,7 @@
#include "grit/generated_resources.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
#import "third_party/ocmock/OCMock/OCMock.h"
@@ -73,28 +74,28 @@ TEST_F(AutocompleteTextFieldEditorTest, InsertStripsControlChars) {
[editor_ selectAll:nil];
[editor_ insertText:@"t"];
- EXPECT_TRUE([[field_ stringValue] isEqualToString:@"t"]);
+ EXPECT_NSEQ(@"t", [field_ stringValue]);
[editor_ insertText:@"h"];
- EXPECT_TRUE([[field_ stringValue] isEqualToString:@"th"]);
+ EXPECT_NSEQ(@"th", [field_ stringValue]);
// TAB doesn't get inserted.
[editor_ insertText:[NSString stringWithFormat:@"%c", 7]];
- EXPECT_TRUE([[field_ stringValue] isEqualToString:@"th"]);
+ EXPECT_NSEQ(@"th", [field_ stringValue]);
// Newline doesn't get inserted.
[editor_ insertText:[NSString stringWithFormat:@"%c", 12]];
- EXPECT_TRUE([[field_ stringValue] isEqualToString:@"th"]);
+ EXPECT_NSEQ(@"th", [field_ stringValue]);
// Multi-character strings get through.
[editor_ insertText:[NSString stringWithFormat:@"i%cs%c", 8, 127]];
- EXPECT_TRUE([[field_ stringValue] isEqualToString:@"this"]);
+ EXPECT_NSEQ(@"this", [field_ stringValue]);
// Attempting to insert newline when everything is selected clears
// the field.
[editor_ selectAll:nil];
[editor_ insertText:[NSString stringWithFormat:@"%c", 12]];
- EXPECT_TRUE([[field_ stringValue] isEqualToString:@""]);
+ EXPECT_NSEQ(@"", [field_ stringValue]);
}
// Test that |delegate| can provide page action menus.
diff --git a/chrome/browser/cocoa/location_bar/autocomplete_text_field_unittest.mm b/chrome/browser/cocoa/location_bar/autocomplete_text_field_unittest.mm
index 29beb38..f39400e 100644
--- a/chrome/browser/cocoa/location_bar/autocomplete_text_field_unittest.mm
+++ b/chrome/browser/cocoa/location_bar/autocomplete_text_field_unittest.mm
@@ -16,6 +16,7 @@
#include "grit/theme_resources.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
using ::testing::InSequence;
@@ -654,11 +655,11 @@ TEST_F(AutocompleteTextFieldTest, SetAttributedStringBaseline) {
attributes:attributes]);
// Check that what we get back looks like what we put in.
- EXPECT_FALSE([[field_ stringValue] isEqualToString:kString]);
+ EXPECT_NSNE(kString, [field_ stringValue]);
[field_ setAttributedStringValue:attributedString];
EXPECT_TRUE([[field_ attributedStringValue]
isEqualToAttributedString:attributedString]);
- EXPECT_TRUE([[field_ stringValue] isEqualToString:kString]);
+ EXPECT_NSEQ(kString, [field_ stringValue]);
// Try that again with focus.
[test_window() makePretendKeyWindowAndSetFirstResponder:field_];
@@ -667,11 +668,11 @@ TEST_F(AutocompleteTextFieldTest, SetAttributedStringBaseline) {
// Check that what we get back looks like what we put in.
[field_ setStringValue:@""];
- EXPECT_FALSE([[field_ stringValue] isEqualToString:kString]);
+ EXPECT_NSNE(kString, [field_ stringValue]);
[field_ setAttributedStringValue:attributedString];
EXPECT_TRUE([[field_ attributedStringValue]
isEqualToAttributedString:attributedString]);
- EXPECT_TRUE([[field_ stringValue] isEqualToString:kString]);
+ EXPECT_NSEQ(kString, [field_ stringValue]);
}
// -setAttributedStringValue: shouldn't reset the undo state if things
diff --git a/chrome/browser/cocoa/location_bar/selected_keyword_decoration_unittest.mm b/chrome/browser/cocoa/location_bar/selected_keyword_decoration_unittest.mm
index bd0f42f..6a7907a5 100644
--- a/chrome/browser/cocoa/location_bar/selected_keyword_decoration_unittest.mm
+++ b/chrome/browser/cocoa/location_bar/selected_keyword_decoration_unittest.mm
@@ -8,6 +8,7 @@
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
namespace {
@@ -41,24 +42,24 @@ TEST_F(SelectedKeywordDecorationTest, UsesPartialKeywordIfNarrow) {
// Wide width chooses the full string and image.
const CGFloat all_width = decoration_.GetWidthForSpace(kWidth);
EXPECT_TRUE(decoration_.image_);
- EXPECT_TRUE([decoration_.label_ isEqualToString:kFullString]);
+ EXPECT_NSEQ(kFullString, decoration_.label_);
// If not enough space to include the image, uses exactly the full
// string.
const CGFloat full_width = decoration_.GetWidthForSpace(all_width - 5.0);
EXPECT_LT(full_width, all_width);
EXPECT_FALSE(decoration_.image_);
- EXPECT_TRUE([decoration_.label_ isEqualToString:kFullString]);
+ EXPECT_NSEQ(kFullString, decoration_.label_);
// Narrow width chooses the partial string.
const CGFloat partial_width = decoration_.GetWidthForSpace(kNarrowWidth);
EXPECT_LT(partial_width, full_width);
EXPECT_FALSE(decoration_.image_);
- EXPECT_TRUE([decoration_.label_ isEqualToString:kPartialString]);
+ EXPECT_NSEQ(kPartialString, decoration_.label_);
// Narrow doesn't choose partial string if there is not one.
decoration_.partial_string_.reset();
decoration_.GetWidthForSpace(kNarrowWidth);
EXPECT_FALSE(decoration_.image_);
- EXPECT_TRUE([decoration_.label_ isEqualToString:kFullString]);
+ EXPECT_NSEQ(kFullString, decoration_.label_);
}
diff --git a/chrome/browser/cocoa/preferences_window_controller_unittest.mm b/chrome/browser/cocoa/preferences_window_controller_unittest.mm
index cd47d5c..c22a581 100644
--- a/chrome/browser/cocoa/preferences_window_controller_unittest.mm
+++ b/chrome/browser/cocoa/preferences_window_controller_unittest.mm
@@ -12,6 +12,7 @@
#include "chrome/browser/options_window.h"
#include "chrome/common/pref_names.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// Helper Objective-C object that sets a BOOL when we get a particular
@@ -197,27 +198,25 @@ TEST_F(PrefsControllerTest, SwitchToPage) {
EXPECT_TRUE([basicsView isDescendantOf:contentView]);
EXPECT_FALSE([personalStuffView isDescendantOf:contentView]);
EXPECT_FALSE([underTheHoodView isDescendantOf:contentView]);
- EXPECT_TRUE([[toolbar selectedItemIdentifier] isEqualTo:basicsIdentifier]);
+ EXPECT_NSEQ(basicsIdentifier, [toolbar selectedItemIdentifier]);
EXPECT_EQ(OPTIONS_PAGE_GENERAL, lastSelectedPage->GetValue());
- EXPECT_TRUE([[window title] isEqualTo:[basicsToolbarItem label]]);
+ EXPECT_NSEQ([basicsToolbarItem label], [window title]);
[pref_controller_ switchToPage:OPTIONS_PAGE_CONTENT animate:NO];
EXPECT_FALSE([basicsView isDescendantOf:contentView]);
EXPECT_TRUE([personalStuffView isDescendantOf:contentView]);
EXPECT_FALSE([underTheHoodView isDescendantOf:contentView]);
- EXPECT_TRUE([[toolbar selectedItemIdentifier]
- isEqualTo:personalStuffIdentifier]);
+ EXPECT_NSEQ([toolbar selectedItemIdentifier], personalStuffIdentifier);
EXPECT_EQ(OPTIONS_PAGE_CONTENT, lastSelectedPage->GetValue());
- EXPECT_TRUE([[window title] isEqualTo:[personalStuffToolbarItem label]]);
+ EXPECT_NSEQ([personalStuffToolbarItem label], [window title]);
[pref_controller_ switchToPage:OPTIONS_PAGE_ADVANCED animate:NO];
EXPECT_FALSE([basicsView isDescendantOf:contentView]);
EXPECT_FALSE([personalStuffView isDescendantOf:contentView]);
EXPECT_TRUE([underTheHoodView isDescendantOf:contentView]);
- EXPECT_TRUE([[toolbar selectedItemIdentifier]
- isEqualTo:underTheHoodIdentifier]);
+ EXPECT_NSEQ([toolbar selectedItemIdentifier], underTheHoodIdentifier);
EXPECT_EQ(OPTIONS_PAGE_ADVANCED, lastSelectedPage->GetValue());
- EXPECT_TRUE([[window title] isEqualTo:[underTheHoodToolbarItem label]]);
+ EXPECT_NSEQ([underTheHoodToolbarItem label], [window title]);
// Test OPTIONS_PAGE_DEFAULT.
@@ -226,10 +225,9 @@ TEST_F(PrefsControllerTest, SwitchToPage) {
EXPECT_FALSE([basicsView isDescendantOf:contentView]);
EXPECT_TRUE([personalStuffView isDescendantOf:contentView]);
EXPECT_FALSE([underTheHoodView isDescendantOf:contentView]);
- EXPECT_TRUE([[toolbar selectedItemIdentifier]
- isEqualTo:personalStuffIdentifier]);
+ EXPECT_NSEQ(personalStuffIdentifier, [toolbar selectedItemIdentifier]);
EXPECT_EQ(OPTIONS_PAGE_CONTENT, lastSelectedPage->GetValue());
- EXPECT_TRUE([[window title] isEqualTo:[personalStuffToolbarItem label]]);
+ EXPECT_NSEQ([personalStuffToolbarItem label], [window title]);
// TODO(akalin): Figure out how to test animation; we'll need everything
// to stick around until the animation finishes.
diff --git a/chrome/browser/cocoa/search_engine_list_model_unittest.mm b/chrome/browser/cocoa/search_engine_list_model_unittest.mm
index c6a45cf..683d454 100644
--- a/chrome/browser/cocoa/search_engine_list_model_unittest.mm
+++ b/chrome/browser/cocoa/search_engine_list_model_unittest.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// A helper for NSNotifications. Makes a note that it's been called back.
@@ -103,7 +104,7 @@ TEST_F(SearchEngineListModelTest, Default) {
EXPECT_EQ([model_ defaultIndex], 2U);
NSString* defaultString = [[model_ searchEngines] objectAtIndex:2];
- EXPECT_TRUE([@"google4" isEqualToString:defaultString]);
+ EXPECT_NSEQ(@"google4", defaultString);
}
// Make sure that when the back-end model changes that we get a notification.
diff --git a/chrome/browser/cocoa/status_bubble_mac_unittest.mm b/chrome/browser/cocoa/status_bubble_mac_unittest.mm
index d61b270..1da754d 100644
--- a/chrome/browser/cocoa/status_bubble_mac_unittest.mm
+++ b/chrome/browser/cocoa/status_bubble_mac_unittest.mm
@@ -12,6 +12,7 @@
#import "chrome/browser/cocoa/status_bubble_mac.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// The test delegate records all of the status bubble object's state
@@ -113,12 +114,12 @@ class StatusBubbleMacTest : public CocoaTest {
TEST_F(StatusBubbleMacTest, SetStatus) {
bubble_->SetStatus(L"");
bubble_->SetStatus(L"This is a test");
- EXPECT_TRUE([GetText() isEqualToString:@"This is a test"]);
+ EXPECT_NSEQ(@"This is a test", GetText());
EXPECT_TRUE(IsVisible());
// Set the status to the exact same thing again
bubble_->SetStatus(L"This is a test");
- EXPECT_TRUE([GetText() isEqualToString:@"This is a test"]);
+ EXPECT_NSEQ(@"This is a test", GetText());
// Hide it
bubble_->SetStatus(L"");
@@ -132,16 +133,16 @@ TEST_F(StatusBubbleMacTest, SetURL) {
EXPECT_FALSE(IsVisible());
bubble_->SetURL(GURL("http://"), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetURLText() isEqualToString:@"http:"]);
+ EXPECT_NSEQ(@"http:", GetURLText());
bubble_->SetURL(GURL("about:blank"), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetURLText() isEqualToString:@"about:blank"]);
+ EXPECT_NSEQ(@"about:blank", GetURLText());
bubble_->SetURL(GURL("foopy://"), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetURLText() isEqualToString:@"foopy://"]);
+ EXPECT_NSEQ(@"foopy://", GetURLText());
bubble_->SetURL(GURL("http://www.cnn.com"), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetURLText() isEqualToString:@"www.cnn.com"]);
+ EXPECT_NSEQ(@"www.cnn.com", GetURLText());
}
// Test hiding bubble that's already hidden.
@@ -159,24 +160,24 @@ TEST_F(StatusBubbleMacTest, SetStatusAndURL) {
EXPECT_FALSE(IsVisible());
bubble_->SetStatus(L"Status");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetBubbleViewText() isEqualToString:@"Status"]);
+ EXPECT_NSEQ(@"Status", GetBubbleViewText());
bubble_->SetURL(GURL("http://www.nytimes.com"), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetBubbleViewText() isEqualToString:@"www.nytimes.com"]);
+ EXPECT_NSEQ(@"www.nytimes.com", GetBubbleViewText());
bubble_->SetURL(GURL(), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetBubbleViewText() isEqualToString:@"Status"]);
+ EXPECT_NSEQ(@"Status", GetBubbleViewText());
bubble_->SetStatus(L"");
EXPECT_FALSE(IsVisible());
bubble_->SetURL(GURL("http://www.nytimes.com"), L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetBubbleViewText() isEqualToString:@"www.nytimes.com"]);
+ EXPECT_NSEQ(@"www.nytimes.com", GetBubbleViewText());
bubble_->SetStatus(L"Status");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetBubbleViewText() isEqualToString:@"Status"]);
+ EXPECT_NSEQ(@"Status", GetBubbleViewText());
bubble_->SetStatus(L"");
EXPECT_TRUE(IsVisible());
- EXPECT_TRUE([GetBubbleViewText() isEqualToString:@"www.nytimes.com"]);
+ EXPECT_NSEQ(@"www.nytimes.com", GetBubbleViewText());
bubble_->SetURL(GURL(), L"");
EXPECT_FALSE(IsVisible());
}
diff --git a/chrome/browser/cocoa/tab_controller_unittest.mm b/chrome/browser/cocoa/tab_controller_unittest.mm
index 16f527c..51f453e 100644
--- a/chrome/browser/cocoa/tab_controller_unittest.mm
+++ b/chrome/browser/cocoa/tab_controller_unittest.mm
@@ -9,6 +9,7 @@
#import "chrome/browser/cocoa/tab_controller_target.h"
#include "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
// Implements the target interface for the tab, which gets sent messages when
@@ -121,7 +122,7 @@ TEST_F(TabControllerTest, ToolTip) {
EXPECT_TRUE([[controller toolTip] length] == 0);
NSString *tooltip_string = @"Some text to use as a tab title";
[controller setTitle:tooltip_string];
- EXPECT_TRUE([tooltip_string isEqualToString:[controller toolTip]]);
+ EXPECT_NSEQ(tooltip_string, [controller toolTip]);
}
// Tests setting the |loading| property via code.
diff --git a/chrome/browser/cocoa/tab_view_picker_table_unittest.mm b/chrome/browser/cocoa/tab_view_picker_table_unittest.mm
index 00440fe..3055844 100644
--- a/chrome/browser/cocoa/tab_view_picker_table_unittest.mm
+++ b/chrome/browser/cocoa/tab_view_picker_table_unittest.mm
@@ -10,6 +10,7 @@
#include "base/scoped_nsobject.h"
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
@interface TabViewPickerTableTestPing : NSObject <NSTabViewDelegate> {
@@ -100,15 +101,15 @@ TEST_F(TabViewPickerTableTest, RowsCorrect) {
id item;
item = [[view_ dataSource] outlineView:view_ child:0 ofItem:nil];
- EXPECT_TRUE([@"label 1" isEqualToString:[[view_ dataSource]
- outlineView:view_
- objectValueForTableColumn:nil // ignored
- byItem:item]]);
+ EXPECT_NSEQ(@"label 1",
+ [[view_ dataSource] outlineView:view_
+ objectValueForTableColumn:nil // ignored
+ byItem:item]);
item = [[view_ dataSource] outlineView:view_ child:1 ofItem:nil];
- EXPECT_TRUE([@"label 2" isEqualToString:[[view_ dataSource]
- outlineView:view_
- objectValueForTableColumn:nil // ignored
- byItem:item]]);
+ EXPECT_NSEQ(@"label 2",
+ [[view_ dataSource] outlineView:view_
+ objectValueForTableColumn:nil // ignored
+ byItem:item]);
}
TEST_F(TabViewPickerTableTest, TestListUpdatesTabView) {
diff --git a/chrome/browser/cocoa/task_manager_mac_unittest.mm b/chrome/browser/cocoa/task_manager_mac_unittest.mm
index 60366c7..2275e14 100644
--- a/chrome/browser/cocoa/task_manager_mac_unittest.mm
+++ b/chrome/browser/cocoa/task_manager_mac_unittest.mm
@@ -10,6 +10,7 @@
#import "chrome/browser/cocoa/cocoa_test_helper.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
+#import "testing/gtest_mac.h"
#include "testing/platform_test.h"
namespace {
@@ -63,11 +64,11 @@ TEST_F(TaskManagerWindowControllerTest, Sort) {
[NSNumber numberWithInt:IDS_TASK_MANAGER_PAGE_COLUMN]];
NSCell* cell;
cell = [controller tableView:table dataCellForTableColumn:title_column row:0];
- EXPECT_TRUE([@"zzb" isEqualToString:[cell title]]);
+ EXPECT_NSEQ(@"zzb", [cell title]);
cell = [controller tableView:table dataCellForTableColumn:title_column row:1];
- EXPECT_TRUE([@"zza" isEqualToString:[cell title]]);
+ EXPECT_NSEQ(@"zza", [cell title]);
cell = [controller tableView:table dataCellForTableColumn:title_column row:2];
- EXPECT_TRUE([@"zzz" isEqualToString:[cell title]]);
+ EXPECT_NSEQ(@"zzz", [cell title]);
// Releases the controller, which in turn deletes |bridge|.
[controller close];