| Index: chrome/browser/pdf/pdf_extension_test.cc
|
| diff --git a/chrome/browser/pdf/pdf_extension_test.cc b/chrome/browser/pdf/pdf_extension_test.cc
|
| index 52e0abb91c1d3ddd7dbdebe7dc38e13beb9e89b6..8220c234d88aaa73165586d9e4c8542b93f44e91 100644
|
| --- a/chrome/browser/pdf/pdf_extension_test.cc
|
| +++ b/chrome/browser/pdf/pdf_extension_test.cc
|
| @@ -30,6 +30,7 @@
|
| #include "chrome/common/chrome_content_client.h"
|
| #include "chrome/common/chrome_paths.h"
|
| #include "chrome/common/chrome_switches.h"
|
| +#include "chrome/common/pref_names.h"
|
| #include "chrome/test/base/ui_test_utils.h"
|
| #include "components/zoom/page_zoom.h"
|
| #include "components/zoom/test/zoom_test_utils.h"
|
| @@ -283,7 +284,6 @@ class PDFExtensionTest : public ExtensionApiTest,
|
|
|
| point->SetPoint(x, y);
|
| }
|
| -
|
| };
|
|
|
| IN_PROC_BROWSER_TEST_P(PDFExtensionTest, Load) {
|
| @@ -295,21 +295,14 @@ IN_PROC_BROWSER_TEST_P(PDFExtensionTest, Load) {
|
| LoadAllPdfsTest("pdf", GetParam());
|
| }
|
|
|
| -class DisablePluginHelper : public content::DownloadManager::Observer,
|
| - public content::NotificationObserver {
|
| +class DisablePluginHelper : public content::DownloadManager::Observer {
|
| public:
|
| DisablePluginHelper() {}
|
| ~DisablePluginHelper() override {}
|
|
|
| void DisablePlugin(Profile* profile) {
|
| - registrar_.Add(this, chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED,
|
| - content::Source<Profile>(profile));
|
| - scoped_refptr<PluginPrefs> prefs(PluginPrefs::GetForProfile(profile));
|
| - DCHECK(prefs.get());
|
| - prefs->EnablePluginGroup(
|
| - false, base::UTF8ToUTF16(ChromeContentClient::kPDFPluginName));
|
| - // Wait until the plugin has been disabled.
|
| - disable_run_loop_.Run();
|
| + profile->GetPrefs()->SetBoolean(
|
| + prefs::kPluginsAlwaysOpenPdfExternally, true);
|
| }
|
|
|
| const GURL& GetLastUrl() {
|
| @@ -325,17 +318,8 @@ class DisablePluginHelper : public content::DownloadManager::Observer,
|
| download_run_loop_.Quit();
|
| }
|
|
|
| - // content::NotificationObserver implementation.
|
| - void Observe(int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) override {
|
| - DCHECK_EQ(chrome::NOTIFICATION_PLUGIN_ENABLE_STATUS_CHANGED, type);
|
| - disable_run_loop_.Quit();
|
| - }
|
| -
|
| private:
|
| content::NotificationRegistrar registrar_;
|
| - base::RunLoop disable_run_loop_;
|
| base::RunLoop download_run_loop_;
|
| GURL last_url_;
|
| };
|
|
|