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 "chrome/browser/autocomplete/shortcuts_provider.h" | 5 #include "chrome/browser/autocomplete/shortcuts_provider.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <functional> | 10 #include <functional> |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/autocomplete/shortcuts_backend.h" | 25 #include "chrome/browser/autocomplete/shortcuts_backend.h" |
26 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" | 26 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" |
27 #include "chrome/browser/chrome_notification_types.h" | 27 #include "chrome/browser/chrome_notification_types.h" |
28 #include "chrome/browser/history/history_service.h" | 28 #include "chrome/browser/history/history_service.h" |
29 #include "chrome/browser/history/in_memory_url_index.h" | 29 #include "chrome/browser/history/in_memory_url_index.h" |
30 #include "chrome/browser/history/url_database.h" | 30 #include "chrome/browser/history/url_database.h" |
31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
32 #include "chrome/test/base/testing_profile.h" | 32 #include "chrome/test/base/testing_profile.h" |
33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
34 #include "content/public/test/test_browser_thread.h" | 34 #include "content/public/test/test_browser_thread.h" |
| 35 #include "extensions/browser/extension_registry.h" |
35 #include "extensions/common/extension.h" | 36 #include "extensions/common/extension.h" |
36 #include "extensions/common/extension_builder.h" | 37 #include "extensions/common/extension_builder.h" |
37 #include "extensions/common/value_builder.h" | 38 #include "extensions/common/value_builder.h" |
38 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
39 | 40 |
40 using base::ASCIIToUTF16; | 41 using base::ASCIIToUTF16; |
41 | 42 |
42 // TestShortcutInfo ----------------------------------------------------------- | 43 // TestShortcutInfo ----------------------------------------------------------- |
43 | 44 |
44 namespace { | 45 namespace { |
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 RunTest(text, false, expected_urls, expected_url, ASCIIToUTF16(" echo")); | 835 RunTest(text, false, expected_urls, expected_url, ASCIIToUTF16(" echo")); |
835 | 836 |
836 // Claim the extension has been unloaded. | 837 // Claim the extension has been unloaded. |
837 scoped_refptr<const extensions::Extension> extension = | 838 scoped_refptr<const extensions::Extension> extension = |
838 extensions::ExtensionBuilder() | 839 extensions::ExtensionBuilder() |
839 .SetManifest(extensions::DictionaryBuilder() | 840 .SetManifest(extensions::DictionaryBuilder() |
840 .Set("name", "Echo") | 841 .Set("name", "Echo") |
841 .Set("version", "1.0")) | 842 .Set("version", "1.0")) |
842 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") | 843 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") |
843 .Build(); | 844 .Build(); |
844 extensions::UnloadedExtensionInfo details( | 845 extensions::ExtensionRegistry* registry = |
| 846 extensions::ExtensionRegistry::Get(&profile_); |
| 847 registry->TriggerOnUnloaded( |
845 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); | 848 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); |
846 content::NotificationService::current()->Notify( | |
847 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, | |
848 content::Source<Profile>(&profile_), | |
849 content::Details<extensions::UnloadedExtensionInfo>(&details)); | |
850 | 849 |
851 // Now the URL should have disappeared. | 850 // Now the URL should have disappeared. |
852 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); | 851 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); |
853 } | 852 } |
OLD | NEW |