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

Unified Diff: ios/web/shell/test/web_shell_navigation_egtest.mm

Issue 2005023003: Change iOS web matcher argument types to std::string. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: const & Created 4 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
« no previous file with comments | « ios/web/shell/test/earl_grey/shell_matchers.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/shell/test/web_shell_navigation_egtest.mm
diff --git a/ios/web/shell/test/web_shell_navigation_egtest.mm b/ios/web/shell/test/web_shell_navigation_egtest.mm
index 04e0f3cf7bb13c234d1b7f494b9bc2150922f106..e3a58281a5b9764af9cfc3d648af87073c3298d2 100644
--- a/ios/web/shell/test/web_shell_navigation_egtest.mm
+++ b/ios/web/shell/test/web_shell_navigation_egtest.mm
@@ -26,7 +26,7 @@
// Set up called once for the class.
+ (void)setUp {
[super setUp];
- [[EarlGrey selectElementWithMatcher:web::webViewContainingText(@"Chromium")]
+ [[EarlGrey selectElementWithMatcher:web::webViewContainingText("Chromium")]
assertWithMatcher:grey_notNil()];
web::test::HttpServer& server = web::test::HttpServer::GetSharedInstance();
server.StartOrDie();
@@ -52,19 +52,18 @@
- (void)testNavigationLinkToAboutBlank {
const GURL URL = web::test::HttpServer::MakeUrl(
"http://ios/web/shell/test/http_server_files/basic_navigation_test.html");
- NSString* URLSpec = base::SysUTF8ToNSString(URL.spec());
web::test::SetUpFileBasedHttpServer();
// TODO(crbug.com/611515): Create web shell utility that only requires URL,
// and gets the web state and passes it in to the web view utility.
web::shell_test_util::LoadUrl(URL);
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URLSpec)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL.spec())]
assertWithMatcher:grey_notNil()];
web::shell_test_util::TapWebViewElementWithId(
"basic-link-navigation-to-about-blank");
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(@"about:blank")]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText("about:blank")]
assertWithMatcher:grey_notNil()];
}
@@ -73,39 +72,37 @@
// Create map of canned responses and set up the test HTML server.
std::map<GURL, std::string> responses;
const GURL URL1 = web::test::HttpServer::MakeUrl("http://firstURL");
- NSString* URL1Text = base::SysUTF8ToNSString(URL1.spec());
- NSString* response1 = @"Test Page 1";
- responses[URL1] = base::SysNSStringToUTF8(response1);
+ std::string response1 = "Test Page 1";
+ responses[URL1] = response1;
const GURL URL2 = web::test::HttpServer::MakeUrl("http://secondURL");
- NSString* URL2Text = base::SysUTF8ToNSString(URL2.spec());
- NSString* response2 = @"Test Page 2";
- responses[URL2] = base::SysNSStringToUTF8(response2);
+ std::string response2 = "Test Page 2";
+ responses[URL2] = response2;
web::test::SetUpSimpleHttpServer(responses);
web::shell_test_util::LoadUrl(URL1);
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1.spec())]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::webViewContainingText(response1)]
assertWithMatcher:grey_notNil()];
web::shell_test_util::LoadUrl(URL2);
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2.spec())]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::webViewContainingText(response2)]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::backButton()]
performAction:grey_tap()];
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1.spec())]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::webViewContainingText(response1)]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::forwardButton()]
performAction:grey_tap()];
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2.spec())]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::webViewContainingText(response2)]
assertWithMatcher:grey_notNil()];
@@ -116,31 +113,29 @@
// Create map of canned responses and set up the test HTML server.
std::map<GURL, std::string> responses;
const GURL URL1 = web::test::HttpServer::MakeUrl("http://fragmentLink");
- NSString* URL1Text = base::SysUTF8ToNSString(URL1.spec());
const std::string response = "<a href='#hash' id='link'>link</a>";
responses[URL1] = response;
const GURL URL2 = web::test::HttpServer::MakeUrl("http://fragmentLink/#hash");
- NSString* URL2Text = base::SysUTF8ToNSString(URL2.spec());
web::test::SetUpSimpleHttpServer(responses);
web::shell_test_util::LoadUrl(URL1);
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1.spec())]
assertWithMatcher:grey_notNil()];
web::shell_test_util::TapWebViewElementWithId("link");
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2.spec())]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::backButton()]
performAction:grey_tap()];
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL1.spec())]
assertWithMatcher:grey_notNil()];
[[EarlGrey selectElementWithMatcher:web::forwardButton()]
performAction:grey_tap()];
- [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2Text)]
+ [[EarlGrey selectElementWithMatcher:web::addressFieldText(URL2.spec())]
assertWithMatcher:grey_notNil()];
}
« no previous file with comments | « ios/web/shell/test/earl_grey/shell_matchers.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698