blob: 93f228faab8f73f91669e869ce1226c9e821c7cc [file] [log] [blame]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import <Foundation/Foundation.h>
// BookmarkEarlGreyAppInterface contains the app-side implementation for
// helpers that primarily work via direct model access. These helpers are
// compiled into the app binary and can be called from either app or test code.
@interface BookmarkEarlGreyAppInterface : NSObject
// Clear Bookmarks top most row position cache.
+ (void)clearBookmarksPositionCache;
// Loads a set of default bookmarks in the model for the tests to use.
+ (NSError*)setupStandardBookmarksUsingFirstURL:(NSString*)firstURL
// Loads a large set of bookmarks in the model which is longer than the screen
// height.
+ (NSError*)setupBookmarksWhichExceedsScreenHeightUsingURL:(NSString*)URL;
// Waits for the Bookmark modedl to be |loaded|.
+ (BOOL)waitForBookmarkModelLoaded:(BOOL)loaded;
// Asserts that |expectedCount| bookmarks exist with the corresponding |title|
// using the BookmarkModel.
+ (NSError*)verifyBookmarksWithTitle:(NSString*)title
// Programmatically adds a bookmark with the given title and URL.
+ (NSError*)addBookmarkWithTitle:(NSString*)title URL:(NSString*)url;
// Removes programmatically the first bookmark with the given title.
+ (NSError*)removeBookmarkWithTitle:(NSString*)title;
// Moves bookmark with title |bookmarkTitle| into a folder with title
// |newFolder|.
+ (NSError*)moveBookmarkWithTitle:(NSString*)bookmarkTitle
// Verifies that there is |count| children on the bookmark folder with |name|.
+ (NSError*)verifyChildCount:(size_t)count inFolderWithName:(NSString*)name;
// Verifies the existence of a Bookmark with |URL| and |name|.
+ (NSError*)verifyExistenceOfBookmarkWithURL:(NSString*)URL
// Verifies the absence of a Bookmark with |URL|.
+ (NSError*)verifyAbsenceOfBookmarkWithURL:(NSString*)URL;
// Verifies that a folder called |title| exists.
+ (NSError*)verifyExistenceOfFolderWithTitle:(NSString*)title;
// Checks that the promo has already been seen or not.
+ (NSError*)verifyPromoAlreadySeen:(BOOL)seen;
// Checks that the promo has already been seen or not.
+ (void)setPromoAlreadySeen:(BOOL)seen;
// Sets that the promo has already been seen |times| number of times.
+ (void)setPromoAlreadySeenNumberOfTimes:(int)times;
// Returns the number of times a Promo has been seen.
+ (int)numberOfTimesPromoAlreadySeen;