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

Side by Side Diff: ios/chrome/browser/web/window_open_by_dom_egtest.mm

Issue 2759613003: Use SameDocument instead of SamePage term on iOS. (Closed)
Patch Set: Actually fixed tests Created 3 years, 9 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <EarlGrey/EarlGrey.h> 5 #import <EarlGrey/EarlGrey.h>
6 6
7 #import "base/test/ios/wait_util.h" 7 #import "base/test/ios/wait_util.h"
8 #include "components/content_settings/core/common/content_settings.h" 8 #include "components/content_settings/core/common/content_settings.h"
9 #include "ios/chrome/test/app/settings_test_util.h" 9 #include "ios/chrome/test/app/settings_test_util.h"
10 #import "ios/chrome/test/app/tab_test_util.h" 10 #import "ios/chrome/test/app/tab_test_util.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 // Tests that sessionStorage content is available for windows opened by DOM via 63 // Tests that sessionStorage content is available for windows opened by DOM via
64 // target="_blank" links. 64 // target="_blank" links.
65 - (void)testLinkWithBlankTargetSessionStorage { 65 - (void)testLinkWithBlankTargetSessionStorage {
66 using chrome_test_util::ExecuteJavaScript; 66 using chrome_test_util::ExecuteJavaScript;
67 67
68 NSError* error = nil; 68 NSError* error = nil;
69 ExecuteJavaScript(@"sessionStorage.setItem('key', 'value');", &error); 69 ExecuteJavaScript(@"sessionStorage.setItem('key', 'value');", &error);
70 GREYAssert(!error, @"Error during script execution: %@", error); 70 GREYAssert(!error, @"Error during script execution: %@", error);
71 71
72 TapWebViewElementWithId("webScenarioWindowOpenSamePageWithBlankTarget"); 72 TapWebViewElementWithId("webScenarioWindowOpenSameURLWithBlankTarget");
73 AssertMainTabCount(2); 73 AssertMainTabCount(2);
74 [[EarlGrey selectElementWithMatcher:WebViewContainingText("Expected result")] 74 [[EarlGrey selectElementWithMatcher:WebViewContainingText("Expected result")]
75 assertWithMatcher:grey_notNil()]; 75 assertWithMatcher:grey_notNil()];
76 76
77 id value = ExecuteJavaScript(@"sessionStorage.getItem('key');", &error); 77 id value = ExecuteJavaScript(@"sessionStorage.getItem('key');", &error);
78 GREYAssert(!error, @"Error during script execution: %@", error); 78 GREYAssert(!error, @"Error during script execution: %@", error);
79 GREYAssert([value isEqual:@"value"], @"sessionStorage is not shared"); 79 GREYAssert([value isEqual:@"value"], @"sessionStorage is not shared");
80 } 80 }
81 81
82 // Tests a link with target="_blank". 82 // Tests a link with target="_blank".
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 assertWithMatcher:grey_notNil()]; 182 assertWithMatcher:grey_notNil()];
183 } 183 }
184 184
185 // Tests that closing the current window using DOM fails. 185 // Tests that closing the current window using DOM fails.
186 - (void)testCloseWindowNotOpenByDOM { 186 - (void)testCloseWindowNotOpenByDOM {
187 TapWebViewElementWithId("webScenarioWindowClose"); 187 TapWebViewElementWithId("webScenarioWindowClose");
188 AssertMainTabCount(1); 188 AssertMainTabCount(1);
189 } 189 }
190 190
191 @end 191 @end
OLDNEW
« 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