| Index: ios/chrome/test/app/bookmarks_test_util.mm
|
| diff --git a/ios/chrome/test/app/bookmarks_test_util.mm b/ios/chrome/test/app/bookmarks_test_util.mm
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..a12de2d027066da0486108a5496a7326d87bc9f8
|
| --- /dev/null
|
| +++ b/ios/chrome/test/app/bookmarks_test_util.mm
|
| @@ -0,0 +1,28 @@
|
| +// Copyright 2016 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 "ios/chrome/test/app/bookmarks_test_util.h"
|
| +
|
| +#include "components/bookmarks/browser/bookmark_model.h"
|
| +#include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
|
| +#include "ios/chrome/browser/bookmarks/bookmarks_utils.h"
|
| +#import "ios/chrome/test/app/chrome_test_util.h"
|
| +
|
| +namespace chrome_test_util {
|
| +
|
| +bool BookmarksLoaded() {
|
| + bookmarks::BookmarkModel* bookmarkModel =
|
| + ios::BookmarkModelFactory::GetForBrowserState(GetOriginalBrowserState());
|
| + return bookmarkModel->loaded();
|
| +}
|
| +
|
| +bool ClearBookmarks() {
|
| + ios::ChromeBrowserState* browserState = GetOriginalBrowserState();
|
| + bookmarks::BookmarkModel* bookmarkModel =
|
| + ios::BookmarkModelFactory::GetForBrowserState(browserState);
|
| + BOOL removeSucceeded = RemoveAllUserBookmarksIOS(browserState);
|
| + return removeSucceeded && !bookmarkModel->HasBookmarks();
|
| +}
|
| +
|
| +} // namespace chrome_test_util
|
|
|