| 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 "extensions/browser/api/declarative/rules_registry_service.h" | 5 #include "extensions/browser/api/declarative/rules_registry_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 registry_service.GetRulesRegistry(key, "ui"), 1)); | 95 registry_service.GetRulesRegistry(key, "ui"), 1)); |
| 96 | 96 |
| 97 content::BrowserThread::PostTask( | 97 content::BrowserThread::PostTask( |
| 98 content::BrowserThread::IO, FROM_HERE, | 98 content::BrowserThread::IO, FROM_HERE, |
| 99 base::Bind(&VerifyNumberOfRules, | 99 base::Bind(&VerifyNumberOfRules, |
| 100 registry_service.GetRulesRegistry(key, "io"), 1)); | 100 registry_service.GetRulesRegistry(key, "io"), 1)); |
| 101 | 101 |
| 102 message_loop_.RunUntilIdle(); | 102 message_loop_.RunUntilIdle(); |
| 103 | 103 |
| 104 // Test extension uninstalling. | 104 // Test extension uninstalling. |
| 105 scoped_ptr<base::DictionaryValue> manifest = DictionaryBuilder() | 105 std::unique_ptr<base::DictionaryValue> manifest = |
| 106 .Set("name", "Extension") | 106 DictionaryBuilder() |
| 107 .Set("version", "1.0") | 107 .Set("name", "Extension") |
| 108 .Set("manifest_version", 2) | 108 .Set("version", "1.0") |
| 109 .Build(); | 109 .Set("manifest_version", 2) |
| 110 .Build(); |
| 110 scoped_refptr<Extension> extension = ExtensionBuilder() | 111 scoped_refptr<Extension> extension = ExtensionBuilder() |
| 111 .SetManifest(std::move(manifest)) | 112 .SetManifest(std::move(manifest)) |
| 112 .SetID(kExtensionId) | 113 .SetID(kExtensionId) |
| 113 .Build(); | 114 .Build(); |
| 114 registry_service.SimulateExtensionUninstalled(extension.get()); | 115 registry_service.SimulateExtensionUninstalled(extension.get()); |
| 115 | 116 |
| 116 content::BrowserThread::PostTask( | 117 content::BrowserThread::PostTask( |
| 117 content::BrowserThread::UI, FROM_HERE, | 118 content::BrowserThread::UI, FROM_HERE, |
| 118 base::Bind(&VerifyNumberOfRules, | 119 base::Bind(&VerifyNumberOfRules, |
| 119 registry_service.GetRulesRegistry(key, "ui"), 0)); | 120 registry_service.GetRulesRegistry(key, "ui"), 0)); |
| 120 | 121 |
| 121 content::BrowserThread::PostTask( | 122 content::BrowserThread::PostTask( |
| 122 content::BrowserThread::IO, FROM_HERE, | 123 content::BrowserThread::IO, FROM_HERE, |
| 123 base::Bind(&VerifyNumberOfRules, | 124 base::Bind(&VerifyNumberOfRules, |
| 124 registry_service.GetRulesRegistry(key, "io"), 0)); | 125 registry_service.GetRulesRegistry(key, "io"), 0)); |
| 125 | 126 |
| 126 message_loop_.RunUntilIdle(); | 127 message_loop_.RunUntilIdle(); |
| 127 } | 128 } |
| 128 | 129 |
| 129 } // namespace extensions | 130 } // namespace extensions |
| OLD | NEW |