Commit f74dd1fa authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Moves classes named TestWebState into anonymous namespaces.

Multiple test files were defined classes named TestWebState in the
global namespace, which is an ODR violations and was causing crashes in
ios_chrome_unittests. Since these are all test-specific helpers, this CL
moves them into anonymous namespaces.

BUG=None

Change-Id: If9ca07916e8d0a5063bb45abe3f971f58c224150
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2335336Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#794236}
parent 5fc9f5ca
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
#error "This file requires ARC support." #error "This file requires ARC support."
#endif #endif
namespace {
class TestWebState : public web::TestWebState { class TestWebState : public web::TestWebState {
public: public:
void LoadURL(const GURL& url) { void LoadURL(const GURL& url) {
...@@ -53,6 +55,8 @@ class TestWebState : public web::TestWebState { ...@@ -53,6 +55,8 @@ class TestWebState : public web::TestWebState {
std::unique_ptr<web::NavigationItem> pending_item_; std::unique_ptr<web::NavigationItem> pending_item_;
}; };
} // namespace
@interface DictionaryParameterSetter : NSObject <CrashReporterParameterSetter> @interface DictionaryParameterSetter : NSObject <CrashReporterParameterSetter>
@property(nonatomic) NSMutableDictionary* params; @property(nonatomic) NSMutableDictionary* params;
@end @end
......
...@@ -26,7 +26,6 @@ const char kTestURL[] = "http://foo.bar"; ...@@ -26,7 +26,6 @@ const char kTestURL[] = "http://foo.bar";
const char kTestTitle[] = "title"; const char kTestTitle[] = "title";
const char kTestDistilledPath[] = "distilled/page.html"; const char kTestDistilledPath[] = "distilled/page.html";
const char kTestDistilledURL[] = "http://foo.bar/distilled"; const char kTestDistilledURL[] = "http://foo.bar/distilled";
}
// A Test navigation manager that checks if Reload was called. // A Test navigation manager that checks if Reload was called.
class TestNavigationManager : public web::TestNavigationManager { class TestNavigationManager : public web::TestNavigationManager {
...@@ -60,6 +59,8 @@ class TestWebState : public web::TestWebState { ...@@ -60,6 +59,8 @@ class TestWebState : public web::TestWebState {
GURL last_opened_url_; GURL last_opened_url_;
}; };
} // namespace
// Test fixture to test loading of Reading list entries. // Test fixture to test loading of Reading list entries.
class ReadingListWebStateObserverTest : public web::WebTest { class ReadingListWebStateObserverTest : public web::WebTest {
public: public:
......
...@@ -33,6 +33,7 @@ using base::test::ios::WaitUntilConditionOrTimeout; ...@@ -33,6 +33,7 @@ using base::test::ios::WaitUntilConditionOrTimeout;
using base::test::ios::kSpinDelaySeconds; using base::test::ios::kSpinDelaySeconds;
namespace { namespace {
// Constants used for testing metrics. // Constants used for testing metrics.
const char kInterstitialDecisionMetric[] = "interstitial.lookalike.decision"; const char kInterstitialDecisionMetric[] = "interstitial.lookalike.decision";
const char kInterstitialInteractionMetric[] = const char kInterstitialInteractionMetric[] =
...@@ -53,7 +54,6 @@ std::unique_ptr<LookalikeUrlBlockingPage> CreateBlockingPage( ...@@ -53,7 +54,6 @@ std::unique_ptr<LookalikeUrlBlockingPage> CreateBlockingPage(
std::make_unique<LookalikeUrlControllerClient>(web_state, safe_url, std::make_unique<LookalikeUrlControllerClient>(web_state, safe_url,
request_url, "en-US")); request_url, "en-US"));
} }
} // namespace
// A Test web state that sets the visible URL to the last opened URL. // A Test web state that sets the visible URL to the last opened URL.
class TestWebState : public web::TestWebState { class TestWebState : public web::TestWebState {
...@@ -63,6 +63,8 @@ class TestWebState : public web::TestWebState { ...@@ -63,6 +63,8 @@ class TestWebState : public web::TestWebState {
} }
}; };
} // namespace
// Test fixture for SafeBrowsingBlockingPage. // Test fixture for SafeBrowsingBlockingPage.
class LookalikeUrlBlockingPageTest : public PlatformTest { class LookalikeUrlBlockingPageTest : public PlatformTest {
public: public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment