OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "chrome/browser/extensions/api/declarative_content/declarative_content_
is_bookmarked_condition_tracker.h" | 5 #include "chrome/browser/extensions/api/declarative_content/declarative_content_
is_bookmarked_condition_tracker.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 93 |
94 private: | 94 private: |
95 std::set<content::WebContents*> evaluation_requests_; | 95 std::set<content::WebContents*> evaluation_requests_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(Delegate); | 97 DISALLOW_COPY_AND_ASSIGN(Delegate); |
98 }; | 98 }; |
99 | 99 |
100 DeclarativeContentIsBookmarkedConditionTrackerTest() { | 100 DeclarativeContentIsBookmarkedConditionTrackerTest() { |
101 profile()->CreateBookmarkModel(true); | 101 profile()->CreateBookmarkModel(true); |
102 bookmarks::test::WaitForBookmarkModelToLoad( | 102 bookmarks::test::WaitForBookmarkModelToLoad( |
103 BookmarkModelFactory::GetForProfile(profile())); | 103 BookmarkModelFactory::GetForBrowserContext(profile())); |
104 bookmark_model_ = BookmarkModelFactory::GetForProfile(profile()); | 104 bookmark_model_ = BookmarkModelFactory::GetForBrowserContext(profile()); |
105 tracker_.reset(new DeclarativeContentIsBookmarkedConditionTracker( | 105 tracker_.reset(new DeclarativeContentIsBookmarkedConditionTracker( |
106 profile(), | 106 profile(), |
107 &delegate_)); | 107 &delegate_)); |
108 extension_ = CreateExtensionWithBookmarksPermission(true); | 108 extension_ = CreateExtensionWithBookmarksPermission(true); |
109 is_bookmarked_predicate_ = CreatePredicate(tracker_.get(), extension_.get(), | 109 is_bookmarked_predicate_ = CreatePredicate(tracker_.get(), extension_.get(), |
110 true); | 110 true); |
111 is_not_bookmarked_predicate_ = CreatePredicate(tracker_.get(), | 111 is_not_bookmarked_predicate_ = CreatePredicate(tracker_.get(), |
112 extension_.get(), false); | 112 extension_.get(), false); |
113 } | 113 } |
114 | 114 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 tracker_->OnWebContentsNavigation(tabs[0].get(), | 426 tracker_->OnWebContentsNavigation(tabs[0].get(), |
427 content::LoadCommittedDetails(), | 427 content::LoadCommittedDetails(), |
428 content::FrameNavigateParams()); | 428 content::FrameNavigateParams()); |
429 EXPECT_THAT(delegate_.evaluation_requests(), | 429 EXPECT_THAT(delegate_.evaluation_requests(), |
430 UnorderedElementsAre(tabs[0].get())); | 430 UnorderedElementsAre(tabs[0].get())); |
431 EXPECT_TRUE(CheckPredicates(tabs[0].get(), false)); | 431 EXPECT_TRUE(CheckPredicates(tabs[0].get(), false)); |
432 EXPECT_TRUE(CheckPredicates(tabs[1].get(), false)); | 432 EXPECT_TRUE(CheckPredicates(tabs[1].get(), false)); |
433 } | 433 } |
434 | 434 |
435 } // namespace extensions | 435 } // namespace extensions |
OLD | NEW |