OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/prefs/scoped_user_pref_update.h" | 8 #include "base/prefs/scoped_user_pref_update.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 // PermissionRequestCreator: | 249 // PermissionRequestCreator: |
250 bool IsEnabled() const override { return enabled_; } | 250 bool IsEnabled() const override { return enabled_; } |
251 | 251 |
252 void CreateURLAccessRequest(const GURL& url_requested, | 252 void CreateURLAccessRequest(const GURL& url_requested, |
253 const SuccessCallback& callback) override { | 253 const SuccessCallback& callback) override { |
254 ASSERT_TRUE(enabled_); | 254 ASSERT_TRUE(enabled_); |
255 requested_urls_.push_back(url_requested); | 255 requested_urls_.push_back(url_requested); |
256 callbacks_.push_back(callback); | 256 callbacks_.push_back(callback); |
257 } | 257 } |
258 | 258 |
259 void CreateExtensionUpdateRequest(const std::string& extension_id, | 259 void CreateExtensionUpdateRequest(const std::string& id, |
260 const SuccessCallback& callback) override { | 260 const SuccessCallback& callback) override { |
261 FAIL(); | 261 FAIL(); |
262 } | 262 } |
263 | 263 |
264 bool enabled_; | 264 bool enabled_; |
265 std::vector<GURL> requested_urls_; | 265 std::vector<GURL> requested_urls_; |
266 std::vector<SuccessCallback> callbacks_; | 266 std::vector<SuccessCallback> callbacks_; |
267 | 267 |
268 DISALLOW_COPY_AND_ASSIGN(MockPermissionRequestCreator); | 268 DISALLOW_COPY_AND_ASSIGN(MockPermissionRequestCreator); |
269 }; | 269 }; |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 ASSERT_EQ(1u, site_list_observer_.sites().size()); | 576 ASSERT_EQ(1u, site_list_observer_.sites().size()); |
577 EXPECT_EQ(base::ASCIIToUTF16("Moose"), site_list_observer_.sites()[0].name); | 577 EXPECT_EQ(base::ASCIIToUTF16("Moose"), site_list_observer_.sites()[0].name); |
578 | 578 |
579 url_filter_observer_.Wait(); | 579 url_filter_observer_.Wait(); |
580 EXPECT_EQ(SupervisedUserURLFilter::WARN, | 580 EXPECT_EQ(SupervisedUserURLFilter::WARN, |
581 url_filter->GetFilteringBehaviorForURL(example_url)); | 581 url_filter->GetFilteringBehaviorForURL(example_url)); |
582 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, | 582 EXPECT_EQ(SupervisedUserURLFilter::ALLOW, |
583 url_filter->GetFilteringBehaviorForURL(moose_url)); | 583 url_filter->GetFilteringBehaviorForURL(moose_url)); |
584 } | 584 } |
585 #endif // defined(ENABLE_EXTENSIONS) | 585 #endif // defined(ENABLE_EXTENSIONS) |
OLD | NEW |