OLD | NEW |
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 <XCTest/XCTest.h> | 6 #import <XCTest/XCTest.h> |
7 | 7 |
8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
9 #include "components/bookmarks/browser/bookmark_model.h" | 9 #include "components/bookmarks/browser/bookmark_model.h" |
10 #include "components/bookmarks/browser/titled_url_match.h" | 10 #include "components/bookmarks/browser/titled_url_match.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 #import "ios/testing/wait_util.h" | 34 #import "ios/testing/wait_util.h" |
35 #import "ios/web/public/test/http_server.h" | 35 #import "ios/web/public/test/http_server.h" |
36 #import "ios/web/public/test/http_server_util.h" | 36 #import "ios/web/public/test/http_server_util.h" |
37 #import "net/base/mac/url_conversions.h" | 37 #import "net/base/mac/url_conversions.h" |
38 #include "ui/base/l10n/l10n_util.h" | 38 #include "ui/base/l10n/l10n_util.h" |
39 #include "url/gurl.h" | 39 #include "url/gurl.h" |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 // Constant for timeout while waiting for asynchronous sync operations. | 43 // Constant for timeout while waiting for asynchronous sync operations. |
44 const NSTimeInterval kSyncOperationTimeout = 5.0; | 44 const NSTimeInterval kSyncOperationTimeout = 10.0; |
45 | 45 |
46 // Returns a fake identity. | 46 // Returns a fake identity. |
47 ChromeIdentity* GetFakeIdentity1() { | 47 ChromeIdentity* GetFakeIdentity1() { |
48 return [FakeChromeIdentity identityWithEmail:@"foo@gmail.com" | 48 return [FakeChromeIdentity identityWithEmail:@"foo@gmail.com" |
49 gaiaID:@"fooID" | 49 gaiaID:@"fooID" |
50 name:@"Fake Foo"]; | 50 name:@"Fake Foo"]; |
51 } | 51 } |
52 | 52 |
53 // Opens the signin screen from the settings page. Must be called from the NTP. | 53 // Opens the signin screen from the settings page. Must be called from the NTP. |
54 // User must not be signed in. | 54 // User must not be signed in. |
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 628 |
629 // Verify the correct number of bookmarks exist. | 629 // Verify the correct number of bookmarks exist. |
630 base::string16 matchString = base::SysNSStringToUTF16(title); | 630 base::string16 matchString = base::SysNSStringToUTF16(title); |
631 std::vector<bookmarks::TitledUrlMatch> matches; | 631 std::vector<bookmarks::TitledUrlMatch> matches; |
632 bookmarkModel->GetBookmarksMatching(matchString, 50, &matches); | 632 bookmarkModel->GetBookmarksMatching(matchString, 50, &matches); |
633 const size_t count = matches.size(); | 633 const size_t count = matches.size(); |
634 GREYAssertEqual(expectedCount, count, @"Unexpected number of bookmarks"); | 634 GREYAssertEqual(expectedCount, count, @"Unexpected number of bookmarks"); |
635 } | 635 } |
636 | 636 |
637 @end | 637 @end |
OLD | NEW |