| 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_
page_url_condition_tracker.h" | 5 #include "chrome/browser/extensions/api/declarative_content/declarative_content_
page_url_condition_tracker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 class Delegate : public ContentPredicateEvaluator::Delegate { | 32 class Delegate : public ContentPredicateEvaluator::Delegate { |
| 33 public: | 33 public: |
| 34 Delegate() {} | 34 Delegate() {} |
| 35 | 35 |
| 36 std::set<content::WebContents*>& evaluation_requests() { | 36 std::set<content::WebContents*>& evaluation_requests() { |
| 37 return evaluation_requests_; | 37 return evaluation_requests_; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // ContentPredicateEvaluator::Delegate: | 40 // ContentPredicateEvaluator::Delegate: |
| 41 void RequestEvaluation(content::WebContents* contents) override { | 41 void RequestEvaluation(content::WebContents* contents) override { |
| 42 EXPECT_FALSE(ContainsKey(evaluation_requests_, contents)); | 42 EXPECT_FALSE(base::ContainsKey(evaluation_requests_, contents)); |
| 43 evaluation_requests_.insert(contents); | 43 evaluation_requests_.insert(contents); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool ShouldManageConditionsForBrowserContext( | 46 bool ShouldManageConditionsForBrowserContext( |
| 47 content::BrowserContext* context) override { | 47 content::BrowserContext* context) override { |
| 48 return true; | 48 return true; |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 std::set<content::WebContents*> evaluation_requests_; | 52 std::set<content::WebContents*> evaluation_requests_; |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 EXPECT_THAT(delegate_.evaluation_requests(), | 284 EXPECT_THAT(delegate_.evaluation_requests(), |
| 285 UnorderedElementsAre(tab.get())); | 285 UnorderedElementsAre(tab.get())); |
| 286 | 286 |
| 287 delegate_.evaluation_requests().clear(); | 287 delegate_.evaluation_requests().clear(); |
| 288 tracker_.StopTrackingPredicates(std::vector<const void*>(1, group)); | 288 tracker_.StopTrackingPredicates(std::vector<const void*>(1, group)); |
| 289 EXPECT_THAT(delegate_.evaluation_requests(), | 289 EXPECT_THAT(delegate_.evaluation_requests(), |
| 290 UnorderedElementsAre(/* empty */)); | 290 UnorderedElementsAre(/* empty */)); |
| 291 } | 291 } |
| 292 | 292 |
| 293 } // namespace extensions | 293 } // namespace extensions |
| OLD | NEW |