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 "components/omnibox/browser/shortcuts_provider.h" | 5 #include "components/omnibox/browser/shortcuts_provider.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 std::string expected_url( | 98 std::string expected_url( |
99 "chrome-extension://cedabbhfglmiikkmdgcpjdkocfcmbkee/?q=echo"); | 99 "chrome-extension://cedabbhfglmiikkmdgcpjdkocfcmbkee/?q=echo"); |
100 ExpectedURLs expected_urls; | 100 ExpectedURLs expected_urls; |
101 expected_urls.push_back(ExpectedURLAndAllowedToBeDefault(expected_url, true)); | 101 expected_urls.push_back(ExpectedURLAndAllowedToBeDefault(expected_url, true)); |
102 RunShortcutsProviderTest(provider_, text, false, expected_urls, expected_url, | 102 RunShortcutsProviderTest(provider_, text, false, expected_urls, expected_url, |
103 base::ASCIIToUTF16(" echo")); | 103 base::ASCIIToUTF16(" echo")); |
104 | 104 |
105 // Claim the extension has been unloaded. | 105 // Claim the extension has been unloaded. |
106 scoped_refptr<const extensions::Extension> extension = | 106 scoped_refptr<const extensions::Extension> extension = |
107 extensions::ExtensionBuilder() | 107 extensions::ExtensionBuilder() |
108 .SetManifest(std::move(extensions::DictionaryBuilder() | 108 .SetManifest(extensions::DictionaryBuilder() |
109 .Set("name", "Echo") | 109 .Set("name", "Echo") |
110 .Set("version", "1.0"))) | 110 .Set("version", "1.0") |
| 111 .Build()) |
111 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") | 112 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") |
112 .Build(); | 113 .Build(); |
113 extensions::UnloadedExtensionInfo details( | 114 extensions::UnloadedExtensionInfo details( |
114 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); | 115 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); |
115 content::NotificationService::current()->Notify( | 116 content::NotificationService::current()->Notify( |
116 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | 117 extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, |
117 content::Source<Profile>(&profile_), | 118 content::Source<Profile>(&profile_), |
118 content::Details<extensions::UnloadedExtensionInfo>(&details)); | 119 content::Details<extensions::UnloadedExtensionInfo>(&details)); |
119 | 120 |
120 // Now the URL should have disappeared. | 121 // Now the URL should have disappeared. |
121 RunShortcutsProviderTest(provider_, text, false, ExpectedURLs(), | 122 RunShortcutsProviderTest(provider_, text, false, ExpectedURLs(), |
122 std::string(), base::string16()); | 123 std::string(), base::string16()); |
123 } | 124 } |
124 #endif | 125 #endif |
OLD | NEW |