Skip to content

Commit 6b91a73

Browse files
pwnallCommit Bot
authored and
Commit Bot
committed
test: Replace _TEST_CASE_ with _TEST_SUITE_ in /ios.
Googletest is (at last) converging with industry-standard terminology [1]. We previously called test suites "test cases", which was rather confusing for folks coming from any other testing framework. Chrome now has a googletest version that supports _TEST_SUITE_ macros instead of _TEST_CASE_, so this CL cleans up some of the outdated usage. [1] https://github.com/google/googletest/blob/master/googletest/docs/primer.md#beware-of-the-nomenclature [email protected] Bug: 925652 Change-Id: Ia05667d07a48f1e04d69efc683c2e4c5e4826a4b Reviewed-on: https://chromium-review.googlesource.com/c/1437353 Commit-Queue: Eugene But <[email protected]> Reviewed-by: Eugene But <[email protected]> Auto-Submit: Victor Costan <[email protected]> Cr-Commit-Position: refs/heads/master@{#631793}
1 parent 6e4df3c commit 6b91a73

9 files changed

+62
-62
lines changed

ios/chrome/app/application_delegate/user_activity_handler_unittest.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,7 @@ conditionBlock getCompletionHandler() {
705705
EXPECT_FALSE(getHandleStartupParametersHasBeenCalled());
706706
}
707707

708-
INSTANTIATE_TEST_CASE_P(
708+
INSTANTIATE_TEST_SUITE_P(
709709
ProgrammaticUserActivityHandlerTest,
710710
UserActivityHandlerTest,
711711
::testing::Values(ExternalFilesLoadedInWebStateFeature::Enabled,

ios/chrome/browser/ui/authentication/chrome_signin_view_controller_unittest.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,9 @@ void WaitAndExpectAllStringsOnScreen() {
376376
FakeChromeSigninViewControllerDelegate* vc_delegate_;
377377
};
378378

379-
INSTANTIATE_TEST_CASE_P(,
380-
ChromeSigninViewControllerTest,
381-
::testing::ValuesIn(kUnifiedConsentParam));
379+
INSTANTIATE_TEST_SUITE_P(,
380+
ChromeSigninViewControllerTest,
381+
::testing::ValuesIn(kUnifiedConsentParam));
382382

383383
// Tests that all strings on the screen are either part of the consent string
384384
// list defined in FakeConsentAuditor::ExpectedConsentStringIds()), or are part

ios/chrome/browser/ui/toolbar_container/toolbar_container_view_controller_unittest.mm

+4-4
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ void CheckToolbarFrames() {
300300
}
301301
}
302302

303-
INSTANTIATE_TEST_CASE_P(,
304-
ToolbarContainerViewControllerTest,
305-
::testing::Range(kEmptyConfig,
306-
kToolbarContainerConfigMax));
303+
INSTANTIATE_TEST_SUITE_P(,
304+
ToolbarContainerViewControllerTest,
305+
::testing::Range(kEmptyConfig,
306+
kToolbarContainerConfigMax));

ios/chrome/browser/voice/voice_search_navigations_tab_helper_unittest.mm

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void SetUp() override {
5757
EXPECT_FALSE(navigations()->IsExpectingVoiceSearch());
5858
}
5959

60-
INSTANTIATE_TEST_CASE_P(ProgrammaticVoiceSearchNavigationsTest,
61-
VoiceSearchNavigationsTest,
62-
::testing::Values(NavigationManagerChoice::LEGACY,
63-
NavigationManagerChoice::WK_BASED));
60+
INSTANTIATE_TEST_SUITE_P(ProgrammaticVoiceSearchNavigationsTest,
61+
VoiceSearchNavigationsTest,
62+
::testing::Values(NavigationManagerChoice::LEGACY,
63+
NavigationManagerChoice::WK_BASED));

ios/net/cookies/cookie_store_ios_persistent_unittest.mm

+12-12
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,18 @@
5656
base::MessageLoop loop_;
5757
};
5858

59-
INSTANTIATE_TYPED_TEST_CASE_P(PersistentCookieStoreIOS,
60-
CookieStoreTest,
61-
PersistentCookieStoreIOSTestTraits);
62-
INSTANTIATE_TYPED_TEST_CASE_P(PersistentCookieStoreIOS,
63-
CookieStoreChangeGlobalTest,
64-
PersistentCookieStoreIOSTestTraits);
65-
INSTANTIATE_TYPED_TEST_CASE_P(PersistentCookieStoreIOS,
66-
CookieStoreChangeUrlTest,
67-
PersistentCookieStoreIOSTestTraits);
68-
INSTANTIATE_TYPED_TEST_CASE_P(PersistentCookieStoreIOS,
69-
CookieStoreChangeNamedTest,
70-
PersistentCookieStoreIOSTestTraits);
59+
INSTANTIATE_TYPED_TEST_SUITE_P(PersistentCookieStoreIOS,
60+
CookieStoreTest,
61+
PersistentCookieStoreIOSTestTraits);
62+
INSTANTIATE_TYPED_TEST_SUITE_P(PersistentCookieStoreIOS,
63+
CookieStoreChangeGlobalTest,
64+
PersistentCookieStoreIOSTestTraits);
65+
INSTANTIATE_TYPED_TEST_SUITE_P(PersistentCookieStoreIOS,
66+
CookieStoreChangeUrlTest,
67+
PersistentCookieStoreIOSTestTraits);
68+
INSTANTIATE_TYPED_TEST_SUITE_P(PersistentCookieStoreIOS,
69+
CookieStoreChangeNamedTest,
70+
PersistentCookieStoreIOSTestTraits);
7171

7272
namespace {
7373

ios/net/cookies/cookie_store_ios_unittest.mm

+12-12
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,18 @@ static void DeliverChangeNotifications() {
7171
base::MessageLoop loop_;
7272
};
7373

74-
INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS,
75-
CookieStoreTest,
76-
CookieStoreIOSTestTraits);
77-
INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS,
78-
CookieStoreChangeGlobalTest,
79-
CookieStoreIOSTestTraits);
80-
INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS,
81-
CookieStoreChangeUrlTest,
82-
CookieStoreIOSTestTraits);
83-
INSTANTIATE_TYPED_TEST_CASE_P(CookieStoreIOS,
84-
CookieStoreChangeNamedTest,
85-
CookieStoreIOSTestTraits);
74+
INSTANTIATE_TYPED_TEST_SUITE_P(CookieStoreIOS,
75+
CookieStoreTest,
76+
CookieStoreIOSTestTraits);
77+
INSTANTIATE_TYPED_TEST_SUITE_P(CookieStoreIOS,
78+
CookieStoreChangeGlobalTest,
79+
CookieStoreIOSTestTraits);
80+
INSTANTIATE_TYPED_TEST_SUITE_P(CookieStoreIOS,
81+
CookieStoreChangeUrlTest,
82+
CookieStoreIOSTestTraits);
83+
INSTANTIATE_TYPED_TEST_SUITE_P(CookieStoreIOS,
84+
CookieStoreChangeNamedTest,
85+
CookieStoreIOSTestTraits);
8686

8787
namespace {
8888

ios/net/cookies/ns_http_system_cookie_store_unittest.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ void ClearCookies() {
6363
std::unique_ptr<net::NSHTTPSystemCookieStore> store_;
6464
};
6565

66-
INSTANTIATE_TYPED_TEST_CASE_P(NSHTTPSystemCookieStore,
67-
SystemCookieStoreTest,
68-
NSHTTPSystemCookieStoreTestDelegate);
66+
INSTANTIATE_TYPED_TEST_SUITE_P(NSHTTPSystemCookieStore,
67+
SystemCookieStoreTest,
68+
NSHTTPSystemCookieStoreTestDelegate);
6969

7070
} // namespace net

ios/net/cookies/system_cookie_store_unittest_template.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class SystemCookieStoreTest : public PlatformTest {
159159
SystemCookieStoreTestDelegate delegate_;
160160
};
161161

162-
TYPED_TEST_CASE_P(SystemCookieStoreTest);
162+
TYPED_TEST_SUITE_P(SystemCookieStoreTest);
163163

164164
TYPED_TEST_P(SystemCookieStoreTest, SetCookieAsync) {
165165
if (!this->IsTestEnabled())
@@ -295,12 +295,12 @@ TYPED_TEST_P(SystemCookieStoreTest, GetCookieAcceptPolicy) {
295295
cookie_store->GetCookieAcceptPolicy());
296296
}
297297

298-
REGISTER_TYPED_TEST_CASE_P(SystemCookieStoreTest,
299-
SetCookieAsync,
300-
GetCookiesAsync,
301-
DeleteCookiesAsync,
302-
ClearCookiesAsync,
303-
GetCookieAcceptPolicy);
298+
REGISTER_TYPED_TEST_SUITE_P(SystemCookieStoreTest,
299+
SetCookieAsync,
300+
GetCookiesAsync,
301+
DeleteCookiesAsync,
302+
ClearCookiesAsync,
303+
GetCookieAcceptPolicy);
304304

305305
} // namespace net
306306

ios/web/web_state/ui/crw_web_controller_unittest.mm

+16-16
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ void SetUp() override {
135135
};
136136

137137
// Macro to simplify instantiation of parameterized tests.
138-
#define INSTANTIATE_TEST_CASES(cls) \
139-
INSTANTIATE_TEST_CASE_P( \
138+
#define INSTANTIATE_TEST_SUITES(cls) \
139+
INSTANTIATE_TEST_SUITE_P( \
140140
Programmatic##cls, cls, \
141141
::testing::Values(NavigationManagerChoice::LEGACY, \
142142
NavigationManagerChoice::WK_BASED));
@@ -329,7 +329,7 @@ GURL native_url(
329329
}
330330
}
331331

332-
INSTANTIATE_TEST_CASES(CRWWebControllerTest);
332+
INSTANTIATE_TEST_SUITES(CRWWebControllerTest);
333333

334334
// Test fixture to test JavaScriptDialogPresenter.
335335
class JavaScriptDialogPresenterTest : public ProgrammaticWebTestWithWebState {
@@ -421,7 +421,7 @@ void TearDown() override {
421421
EXPECT_NSEQ(@"No", dialog.default_prompt_text);
422422
}
423423

424-
INSTANTIATE_TEST_CASES(JavaScriptDialogPresenterTest);
424+
INSTANTIATE_TEST_SUITES(JavaScriptDialogPresenterTest);
425425

426426
// Test fixture for testing visible security state.
427427
typedef ProgrammaticWebTestWithWebState CRWWebStateSecurityStateTest;
@@ -439,7 +439,7 @@ void TearDown() override {
439439
observer.did_change_visible_security_state_info()->web_state);
440440
}
441441

442-
INSTANTIATE_TEST_CASES(CRWWebStateSecurityStateTest);
442+
INSTANTIATE_TEST_SUITES(CRWWebStateSecurityStateTest);
443443

444444
// Real WKWebView is required for CRWWebControllerInvalidUrlTest.
445445
typedef ProgrammaticWebTestWithWebState CRWWebControllerInvalidUrlTest;
@@ -455,7 +455,7 @@ void TearDown() override {
455455
EXPECT_EQ(url, web_state()->GetLastCommittedURL());
456456
}
457457

458-
INSTANTIATE_TEST_CASES(CRWWebControllerInvalidUrlTest);
458+
INSTANTIATE_TEST_SUITES(CRWWebControllerInvalidUrlTest);
459459

460460
// Real WKWebView is required for CRWWebControllerMessageFromIFrame.
461461
typedef ProgrammaticWebTestWithWebState CRWWebControllerMessageFromIFrame;
@@ -473,7 +473,7 @@ void TearDown() override {
473473
"frames['f'].__gCrWeb.message.invokeOnHost(bad_message);");
474474
}
475475

476-
INSTANTIATE_TEST_CASES(CRWWebControllerMessageFromIFrame);
476+
INSTANTIATE_TEST_SUITES(CRWWebControllerMessageFromIFrame);
477477

478478
// Real WKWebView is required for CRWWebControllerJSExecutionTest.
479479
typedef ProgrammaticWebTestWithWebController CRWWebControllerJSExecutionTest;
@@ -500,7 +500,7 @@ void TearDown() override {
500500
EXPECT_FALSE(ExecuteJavaScript(@"window.test2"));
501501
}
502502

503-
INSTANTIATE_TEST_CASES(CRWWebControllerJSExecutionTest);
503+
INSTANTIATE_TEST_SUITES(CRWWebControllerJSExecutionTest);
504504

505505
// Test fixture to test decidePolicyForNavigationResponse:decisionHandler:
506506
// delegate method.
@@ -748,7 +748,7 @@ bool CallDecidePolicyForNavigationResponseWithResponse(
748748
EXPECT_EQ(kAbsolute, trust_level);
749749
}
750750

751-
INSTANTIATE_TEST_CASES(CRWWebControllerResponseTest);
751+
INSTANTIATE_TEST_SUITES(CRWWebControllerResponseTest);
752752

753753
// Test fixture to test decidePolicyForNavigationAction:decisionHandler:
754754
// decisionHandler's callback result.
@@ -819,7 +819,7 @@ bool VerifyDecidePolicyForNavigationAction(
819819
blob_url_request, WKNavigationActionPolicyAllow));
820820
}
821821

822-
INSTANTIATE_TEST_CASES(CRWWebControllerPolicyDeciderTest);
822+
INSTANTIATE_TEST_SUITES(CRWWebControllerPolicyDeciderTest);
823823

824824
// Test fixture for testing CRWWebController presenting native content.
825825
class CRWWebControllerNativeContentTest
@@ -899,7 +899,7 @@ void Load(const GURL& URL) {
899899
virtual_url);
900900
}
901901

902-
INSTANTIATE_TEST_CASES(CRWWebControllerNativeContentTest);
902+
INSTANTIATE_TEST_SUITES(CRWWebControllerNativeContentTest);
903903

904904
// Test fixture for window.open tests.
905905
class WindowOpenByDomTest : public ProgrammaticWebTestWithWebController {
@@ -989,7 +989,7 @@ id OpenWindowByDom() {
989989
EXPECT_TRUE(delegate_.popups().empty());
990990
}
991991

992-
INSTANTIATE_TEST_CASES(WindowOpenByDomTest);
992+
INSTANTIATE_TEST_SUITES(WindowOpenByDomTest);
993993

994994
// Tests page title changes.
995995
typedef ProgrammaticWebTestWithWebState CRWWebControllerTitleTest;
@@ -1040,7 +1040,7 @@ id OpenWindowByDom() {
10401040
EXPECT_EQ("Title1", base::UTF16ToUTF8(web_state()->GetTitle()));
10411041
}
10421042

1043-
INSTANTIATE_TEST_CASES(CRWWebControllerTitleTest);
1043+
INSTANTIATE_TEST_SUITES(CRWWebControllerTitleTest);
10441044

10451045
// Test fixture for JavaScript execution.
10461046
class ScriptExecutionTest : public ProgrammaticWebTestWithWebController {
@@ -1104,7 +1104,7 @@ id ExecuteUserJavaScript(NSString* java_script, NSError** error) {
11041104
EXPECT_FALSE(ExecuteJavaScript(@"window.w"));
11051105
};
11061106

1107-
INSTANTIATE_TEST_CASES(ScriptExecutionTest);
1107+
INSTANTIATE_TEST_SUITES(ScriptExecutionTest);
11081108

11091109
// Fixture class to test WKWebView crashes.
11101110
class CRWWebControllerWebProcessTest
@@ -1160,8 +1160,8 @@ void SetUp() override {
11601160
EXPECT_TRUE(web_state()->IsEvicted());
11611161
};
11621162

1163-
INSTANTIATE_TEST_CASES(CRWWebControllerWebProcessTest);
1163+
INSTANTIATE_TEST_SUITES(CRWWebControllerWebProcessTest);
11641164

1165-
#undef INSTANTIATE_TEST_CASES
1165+
#undef INSTANTIATE_TEST_SUITES
11661166

11671167
} // namespace web

0 commit comments

Comments
 (0)