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

Unified Diff: ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm

Issue 1124173004: [iOS] Upstream //ios/chrome/browser/ui/commands changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation Created 5 years, 7 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: ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
diff --git a/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm b/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
index 143631ff23417d4b861fc0daf61b05293db80c1d..508f7bcdea1dbd6d57f293c56108a84d05847eb7 100644
--- a/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
+++ b/ios/chrome/browser/ui/commands/set_up_for_testing_command_unittest.mm
@@ -20,6 +20,7 @@ TEST_F(SetUpForTestingCommandTest, InitNoArguments) {
[[SetUpForTestingCommand alloc] initWithURL:url]);
EXPECT_FALSE([command clearBrowsingData]);
EXPECT_FALSE([command closeTabs]);
+ EXPECT_EQ(0, [command numberOfNewTabs]);
}
TEST_F(SetUpForTestingCommandTest, InitClearBrowsingData) {
@@ -58,6 +59,15 @@ TEST_F(SetUpForTestingCommandTest, InitWithBadNumberOfNewTabs) {
EXPECT_EQ(0, [command numberOfNewTabs]);
}
+TEST_F(SetUpForTestingCommandTest, InitWithNegativeNumberOfNewTabs) {
+ GURL url("chrome://setupfortesting?numberOfNewTabs=-3");
+ base::scoped_nsobject<SetUpForTestingCommand> command(
+ [[SetUpForTestingCommand alloc] initWithURL:url]);
+ EXPECT_FALSE([command clearBrowsingData]);
+ EXPECT_FALSE([command closeTabs]);
+ EXPECT_EQ(0, [command numberOfNewTabs]);
+}
+
TEST_F(SetUpForTestingCommandTest, InitWithArguments) {
GURL url(
"chrome://setupfortesting?clearBrowsingData&closeTabs&numberOfNewTabs=5");
@@ -74,6 +84,7 @@ TEST_F(SetUpForTestingCommandTest, InitWithBadArguments) {
[[SetUpForTestingCommand alloc] initWithURL:url]);
EXPECT_FALSE([command clearBrowsingData]);
EXPECT_FALSE([command closeTabs]);
+ EXPECT_EQ(0, [command numberOfNewTabs]);
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698