| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 return testing::AssertionFailure() << error; | 94 return testing::AssertionFailure() << error; |
| 95 return testing::AssertionSuccess(); | 95 return testing::AssertionSuccess(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 // A helper class that listens for NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED. | 98 // A helper class that listens for NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED. |
| 99 class PermissionsUpdaterListener : public content::NotificationObserver { | 99 class PermissionsUpdaterListener : public content::NotificationObserver { |
| 100 public: | 100 public: |
| 101 PermissionsUpdaterListener() | 101 PermissionsUpdaterListener() |
| 102 : received_notification_(false), waiting_(false) { | 102 : received_notification_(false), waiting_(false) { |
| 103 registrar_.Add(this, | 103 registrar_.Add(this, |
| 104 chrome::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED, | 104 extensions::NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED, |
| 105 content::NotificationService::AllSources()); | 105 content::NotificationService::AllSources()); |
| 106 } | 106 } |
| 107 | 107 |
| 108 void Reset() { | 108 void Reset() { |
| 109 received_notification_ = false; | 109 received_notification_ = false; |
| 110 waiting_ = false; | 110 waiting_ = false; |
| 111 extension_ = NULL; | 111 extension_ = NULL; |
| 112 permissions_ = NULL; | 112 permissions_ = NULL; |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 EXPECT_TRUE(SetsAreEqual( | 394 EXPECT_TRUE(SetsAreEqual( |
| 395 permissions_data->active_permissions()->explicit_hosts().patterns(), | 395 permissions_data->active_permissions()->explicit_hosts().patterns(), |
| 396 all_patterns)); | 396 all_patterns)); |
| 397 EXPECT_TRUE(permissions_data->withheld_permissions() | 397 EXPECT_TRUE(permissions_data->withheld_permissions() |
| 398 ->explicit_hosts() | 398 ->explicit_hosts() |
| 399 .patterns() | 399 .patterns() |
| 400 .empty()); | 400 .empty()); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace extensions | 403 } // namespace extensions |
| OLD | NEW |