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

Side by Side Diff: content/browser/plugin_browsertest.cc

Issue 645203002: Block NPAPI plugins by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add NPAPI UMA histogram Created 5 years, 11 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
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/loader/resource_dispatcher_host_impl.h" 10 #include "content/browser/loader/resource_dispatcher_host_impl.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 } 67 }
68 } 68 }
69 #elif defined(OS_MACOSX) 69 #elif defined(OS_MACOSX)
70 base::FilePath plugin_dir; 70 base::FilePath plugin_dir;
71 PathService::Get(base::DIR_MODULE, &plugin_dir); 71 PathService::Get(base::DIR_MODULE, &plugin_dir);
72 plugin_dir = plugin_dir.AppendASCII("plugins"); 72 plugin_dir = plugin_dir.AppendASCII("plugins");
73 // The plugins directory isn't read by default on the Mac, so it needs to be 73 // The plugins directory isn't read by default on the Mac, so it needs to be
74 // explicitly registered. 74 // explicitly registered.
75 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir); 75 command_line->AppendSwitchPath(switches::kExtraPluginDir, plugin_dir);
76 #endif 76 #endif
77 command_line->AppendSwitch(switches::kEnableNpapi);
77 } 78 }
78 79
79 void SetUpOnMainThread() override { 80 void SetUpOnMainThread() override {
80 base::FilePath path = GetTestFilePath("", ""); 81 base::FilePath path = GetTestFilePath("", "");
81 BrowserThread::PostTask( 82 BrowserThread::PostTask(
82 BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path)); 83 BrowserThread::IO, FROM_HERE, base::Bind(&SetUrlRequestMock, path));
83 } 84 }
84 85
85 static void LoadAndWaitInWindow(Shell* window, const GURL& url) { 86 static void LoadAndWaitInWindow(Shell* window, const GURL& url) {
86 base::string16 expected_title(ASCIIToUTF16("OK")); 87 base::string16 expected_title(ASCIIToUTF16("OK"));
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 ResourceDispatcherHostDelegate* old_delegate = 558 ResourceDispatcherHostDelegate* old_delegate =
558 ResourceDispatcherHostImpl::Get()->delegate(); 559 ResourceDispatcherHostImpl::Get()->delegate();
559 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate); 560 ResourceDispatcherHostImpl::Get()->SetDelegate(&test_delegate);
560 LoadAndWait(url); 561 LoadAndWait(url);
561 test_delegate.WaitForPluginRequest(); 562 test_delegate.WaitForPluginRequest();
562 ASSERT_TRUE(test_delegate.found_cookie()); 563 ASSERT_TRUE(test_delegate.found_cookie());
563 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate); 564 ResourceDispatcherHostImpl::Get()->SetDelegate(old_delegate);
564 } 565 }
565 566
566 } // namespace content 567 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698