Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: chrome/browser/autocomplete/shortcuts_provider_unittest.cc

Issue 290043003: Revert of Use ExtensionRegistryObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_backend.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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"
36 #include "extensions/common/extension.h" 35 #include "extensions/common/extension.h"
37 #include "extensions/common/extension_builder.h" 36 #include "extensions/common/extension_builder.h"
38 #include "extensions/common/value_builder.h" 37 #include "extensions/common/value_builder.h"
39 #include "testing/gtest/include/gtest/gtest.h" 38 #include "testing/gtest/include/gtest/gtest.h"
40 39
41 using base::ASCIIToUTF16; 40 using base::ASCIIToUTF16;
42 41
43 // TestShortcutInfo ----------------------------------------------------------- 42 // TestShortcutInfo -----------------------------------------------------------
44 43
45 namespace { 44 namespace {
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 RunTest(text, false, expected_urls, expected_url, ASCIIToUTF16(" echo")); 834 RunTest(text, false, expected_urls, expected_url, ASCIIToUTF16(" echo"));
836 835
837 // Claim the extension has been unloaded. 836 // Claim the extension has been unloaded.
838 scoped_refptr<const extensions::Extension> extension = 837 scoped_refptr<const extensions::Extension> extension =
839 extensions::ExtensionBuilder() 838 extensions::ExtensionBuilder()
840 .SetManifest(extensions::DictionaryBuilder() 839 .SetManifest(extensions::DictionaryBuilder()
841 .Set("name", "Echo") 840 .Set("name", "Echo")
842 .Set("version", "1.0")) 841 .Set("version", "1.0"))
843 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee") 842 .SetID("cedabbhfglmiikkmdgcpjdkocfcmbkee")
844 .Build(); 843 .Build();
845 extensions::ExtensionRegistry* registry = 844 extensions::UnloadedExtensionInfo details(
846 extensions::ExtensionRegistry::Get(&profile_);
847 registry->TriggerOnUnloaded(
848 extension.get(), extensions::UnloadedExtensionInfo::REASON_UNINSTALL); 845 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));
849 850
850 // Now the URL should have disappeared. 851 // Now the URL should have disappeared.
851 RunTest(text, false, ExpectedURLs(), std::string(), base::string16()); 852 RunTest(text, false, ExpectedURLs(), std::string(), base::string16());
852 } 853 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/shortcuts_backend.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698