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

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

Issue 271393003: Use ExtensionRegistryObserver instead of deprecated extension notification from autocomplete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: colon to period 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"
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
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 }
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