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

Unified Diff: ios/chrome/browser/web/window_open_by_dom_egtest.mm

Issue 2672893003: EG test for sessionStorage sharing. (Closed)
Patch Set: Addressed review comment Created 3 years, 10 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 | « no previous file | ios/testing/data/http_server_files/window_open.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/web/window_open_by_dom_egtest.mm
diff --git a/ios/chrome/browser/web/window_open_by_dom_egtest.mm b/ios/chrome/browser/web/window_open_by_dom_egtest.mm
index 6df1cbd2ef48826cc16d1bb0d9e0e9e3290aa31a..91dd4fa74071b3128343df6480a3a00568db3298 100644
--- a/ios/chrome/browser/web/window_open_by_dom_egtest.mm
+++ b/ios/chrome/browser/web/window_open_by_dom_egtest.mm
@@ -60,6 +60,26 @@ const char kTestURL[] =
AssertMainTabCount(1);
}
+// Tests that |sessionStorage| content is available for windows opened by DOM
+// via |target="_blank"| links.
+// TODO(crbug.com/681434): Enable this test.
+- (void)DISABLED_testLinkWithBlankTargetSessionStorage {
+ using chrome_test_util::ExecuteJavaScript;
+
+ NSError* error = nil;
+ ExecuteJavaScript(@"sessionStorage.setItem('key', 'value');", &error);
+ GREYAssert(!error, @"Error during script execution: %@", error);
+
+ TapWebViewElementWithId("webScenarioWindowOpenSamePageWithBlankTarget");
+ AssertMainTabCount(2);
+ [[EarlGrey selectElementWithMatcher:WebViewContainingText("Expected result")]
+ assertWithMatcher:grey_notNil()];
+
+ id value = ExecuteJavaScript(@"sessionStorage.getItem('key');", &error);
+ GREYAssert(!error, @"Error during script execution: %@", error);
+ GREYAssert([value isEqual:@"value"], @"sessionStorage is not shared");
+}
+
// Tests a link with target="_blank".
- (void)testLinkWithBlankTarget {
TapWebViewElementWithId("webScenarioWindowOpenRegularLink");
« no previous file with comments | « no previous file | ios/testing/data/http_server_files/window_open.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698