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

Side by Side Diff: ios/chrome/browser/ui/history/history_ui_egtest.mm

Issue 2774633002: Reenable History and Reading List EG tests. (Closed)
Patch Set: 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/chrome/browser/ui/reading_list/reading_list_egtest.mm » ('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 #import <UIKit/UIKit.h> 6 #import <UIKit/UIKit.h>
7 #import <XCTest/XCTest.h> 7 #import <XCTest/XCTest.h>
8 8
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 // Some tests change the default values for the "Clear Browsing Data" settings 228 // Some tests change the default values for the "Clear Browsing Data" settings
229 // screen. 229 // screen.
230 [self resetBrowsingDataPrefs]; 230 [self resetBrowsingDataPrefs];
231 [super tearDown]; 231 [super tearDown];
232 } 232 }
233 233
234 #pragma mark Tests 234 #pragma mark Tests
235 235
236 // Tests that no history is shown if there has been no navigation. 236 // Tests that no history is shown if there has been no navigation.
237 // TODO(crbug.com/704403): Re-enable this test. 237 - (void)testDisplayNoHistory {
238 - (void)DISABLED_testDisplayNoHistory {
239 [self openHistoryPanel]; 238 [self openHistoryPanel];
240 [self assertNoHistoryShown]; 239 [self assertNoHistoryShown];
241 } 240 }
242 241
243 // Tests that the history panel displays navigation history. 242 // Tests that the history panel displays navigation history.
244 // TODO(crbug.com/704403): Re-enable this test. 243 - (void)testDisplayHistory {
245 - (void)DISABLED_testDisplayHistory {
246 [self loadTestURLs]; 244 [self loadTestURLs];
247 [self openHistoryPanel]; 245 [self openHistoryPanel];
248 246
249 // Assert that history displays three entries. 247 // Assert that history displays three entries.
250 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)] 248 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)]
251 assertWithMatcher:grey_notNil()]; 249 assertWithMatcher:grey_notNil()];
252 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)] 250 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)]
253 assertWithMatcher:grey_notNil()]; 251 assertWithMatcher:grey_notNil()];
254 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL3, _URL3.GetContent())] 252 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL3, _URL3.GetContent())]
255 assertWithMatcher:grey_notNil()]; 253 assertWithMatcher:grey_notNil()];
256 254
257 // Tap a history entry and assert that navigation to that entry's URL occurs. 255 // Tap a history entry and assert that navigation to that entry's URL occurs.
258 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)] 256 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)]
259 performAction:grey_tap()]; 257 performAction:grey_tap()];
260 [[EarlGrey selectElementWithMatcher:WebViewContainingText(kResponse1)] 258 [[EarlGrey selectElementWithMatcher:WebViewContainingText(kResponse1)]
261 assertWithMatcher:grey_notNil()]; 259 assertWithMatcher:grey_notNil()];
262 } 260 }
263 261
264 // Tests that history is not changed after performing back navigation. 262 // Tests that history is not changed after performing back navigation.
265 // TODO(crbug.com/704403): Re-enable this test. 263 - (void)testHistoryUpdateAfterBackNavigation {
266 - (void)DISABLED_testHistoryUpdateAfterBackNavigation {
267 [ChromeEarlGrey loadURL:_URL1]; 264 [ChromeEarlGrey loadURL:_URL1];
268 [ChromeEarlGrey loadURL:_URL2]; 265 [ChromeEarlGrey loadURL:_URL2];
269 266
270 [[EarlGrey selectElementWithMatcher:chrome_test_util::BackButton()] 267 [[EarlGrey selectElementWithMatcher:chrome_test_util::BackButton()]
271 performAction:grey_tap()]; 268 performAction:grey_tap()];
272 [[EarlGrey selectElementWithMatcher:WebViewContainingText(kResponse1)] 269 [[EarlGrey selectElementWithMatcher:WebViewContainingText(kResponse1)]
273 assertWithMatcher:grey_notNil()]; 270 assertWithMatcher:grey_notNil()];
274 271
275 [self openHistoryPanel]; 272 [self openHistoryPanel];
276 273
277 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)] 274 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)]
278 assertWithMatcher:grey_notNil()]; 275 assertWithMatcher:grey_notNil()];
279 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)] 276 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)]
280 assertWithMatcher:grey_notNil()]; 277 assertWithMatcher:grey_notNil()];
281 } 278 }
282 279
283 // Test that history displays a message about entries only if the user is logged 280 // Test that history displays a message about entries only if the user is logged
284 // in, and that tapping on the link in the message opens a new tab with the sync 281 // in, and that tapping on the link in the message opens a new tab with the sync
285 // help page. 282 // help page.
286 // TODO(crbug.com/704403): Re-enable this test. 283 - (void)testHistoryEntriesStatusCell {
287 - (void)DISABLED_testHistoryEntriesStatusCell {
288 [self loadTestURLs]; 284 [self loadTestURLs];
289 [self openHistoryPanel]; 285 [self openHistoryPanel];
290 // Assert that no message is shown when the user is not signed in. 286 // Assert that no message is shown when the user is not signed in.
291 NSRange range; 287 NSRange range;
292 NSString* entriesMessage = ParseStringWithLink( 288 NSString* entriesMessage = ParseStringWithLink(
293 l10n_util::GetNSString(IDS_IOS_HISTORY_NO_SYNCED_RESULTS), &range); 289 l10n_util::GetNSString(IDS_IOS_HISTORY_NO_SYNCED_RESULTS), &range);
294 [[EarlGrey selectElementWithMatcher:grey_text(entriesMessage)] 290 [[EarlGrey selectElementWithMatcher:grey_text(entriesMessage)]
295 assertWithMatcher:grey_nil()]; 291 assertWithMatcher:grey_nil()];
296 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()] 292 [[EarlGrey selectElementWithMatcher:NavigationBarDoneButton()]
297 performAction:grey_tap()]; 293 performAction:grey_tap()];
(...skipping 12 matching lines...) Expand all
310 selectElementWithMatcher:grey_kindOfClass([TransparentLinkButton class])] 306 selectElementWithMatcher:grey_kindOfClass([TransparentLinkButton class])]
311 performAction:grey_tap()]; 307 performAction:grey_tap()];
312 chrome_test_util::AssertMainTabCount(2); 308 chrome_test_util::AssertMainTabCount(2);
313 id<GREYMatcher> webViewMatcher = 309 id<GREYMatcher> webViewMatcher =
314 WebViewContainingText("Sync and view tabs and history across devices"); 310 WebViewContainingText("Sync and view tabs and history across devices");
315 [[EarlGrey selectElementWithMatcher:webViewMatcher] 311 [[EarlGrey selectElementWithMatcher:webViewMatcher]
316 assertWithMatcher:grey_notNil()]; 312 assertWithMatcher:grey_notNil()];
317 } 313 }
318 314
319 // Tests that searching history displays only entries matching the search term. 315 // Tests that searching history displays only entries matching the search term.
320 // TODO(crbug.com/704403): Re-enable this test. 316 - (void)testSearchHistory {
321 - (void)DISABLED_testSearchHistory {
322 [self loadTestURLs]; 317 [self loadTestURLs];
323 [self openHistoryPanel]; 318 [self openHistoryPanel];
324 [[EarlGrey selectElementWithMatcher:SearchIconButton()] 319 [[EarlGrey selectElementWithMatcher:SearchIconButton()]
325 performAction:grey_tap()]; 320 performAction:grey_tap()];
326 321
327 NSString* searchString = 322 NSString* searchString =
328 [NSString stringWithFormat:@"%s", _URL1.path().c_str()]; 323 [NSString stringWithFormat:@"%s", _URL1.path().c_str()];
329 [[EarlGrey selectElementWithMatcher:grey_keyWindow()] 324 [[EarlGrey selectElementWithMatcher:grey_keyWindow()]
330 performAction:grey_typeText(searchString)]; 325 performAction:grey_typeText(searchString)];
331 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)] 326 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)]
332 assertWithMatcher:grey_notNil()]; 327 assertWithMatcher:grey_notNil()];
333 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)] 328 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)]
334 assertWithMatcher:grey_nil()]; 329 assertWithMatcher:grey_nil()];
335 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL3, _URL3.GetContent())] 330 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL3, _URL3.GetContent())]
336 assertWithMatcher:grey_nil()]; 331 assertWithMatcher:grey_nil()];
337 } 332 }
338 333
339 // Tests deletion of history entries. 334 // Tests deletion of history entries.
340 // TODO(crbug.com/704403): Re-enable this test. 335 - (void)testDeleteHistory {
341 - (void)DISABLED_testDeleteHistory {
342 [self loadTestURLs]; 336 [self loadTestURLs];
343 [self openHistoryPanel]; 337 [self openHistoryPanel];
344 338
345 // Assert that three history elements are present. 339 // Assert that three history elements are present.
346 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)] 340 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL1, kTitle1)]
347 assertWithMatcher:grey_notNil()]; 341 assertWithMatcher:grey_notNil()];
348 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)] 342 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL2, kTitle2)]
349 assertWithMatcher:grey_notNil()]; 343 assertWithMatcher:grey_notNil()];
350 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL3, _URL3.GetContent())] 344 [[EarlGrey selectElementWithMatcher:HistoryEntry(_URL3, _URL3.GetContent())]
351 assertWithMatcher:grey_notNil()]; 345 assertWithMatcher:grey_notNil()];
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 - (void)resetBrowsingDataPrefs { 529 - (void)resetBrowsingDataPrefs {
536 PrefService* prefs = chrome_test_util::GetOriginalBrowserState()->GetPrefs(); 530 PrefService* prefs = chrome_test_util::GetOriginalBrowserState()->GetPrefs();
537 prefs->ClearPref(browsing_data::prefs::kDeleteBrowsingHistory); 531 prefs->ClearPref(browsing_data::prefs::kDeleteBrowsingHistory);
538 prefs->ClearPref(browsing_data::prefs::kDeleteCookies); 532 prefs->ClearPref(browsing_data::prefs::kDeleteCookies);
539 prefs->ClearPref(browsing_data::prefs::kDeleteCache); 533 prefs->ClearPref(browsing_data::prefs::kDeleteCache);
540 prefs->ClearPref(browsing_data::prefs::kDeletePasswords); 534 prefs->ClearPref(browsing_data::prefs::kDeletePasswords);
541 prefs->ClearPref(browsing_data::prefs::kDeleteFormData); 535 prefs->ClearPref(browsing_data::prefs::kDeleteFormData);
542 } 536 }
543 537
544 @end 538 @end
OLDNEW
« no previous file with comments | « no previous file | ios/chrome/browser/ui/reading_list/reading_list_egtest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698