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

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

Issue 9981015: Add an interface for Flash to clear its data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/browser/plugin_service_impl.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/synchronization/waitable_event_watcher.h" 8 #include "base/synchronization/waitable_event_watcher.h"
9 #include "content/browser/plugin_data_remover_impl.h" 9 #include "content/browser/plugin_data_remover_impl.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
11 #include "chrome/test/base/in_process_browser_test.h" 11 #include "chrome/test/base/in_process_browser_test.h"
12 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
13 13
14 namespace content {
15
14 namespace { 16 namespace {
15 const char* kNPAPITestPluginMimeType = "application/vnd.npapi-test"; 17 const char* kNPAPITestPluginMimeType = "application/vnd.npapi-test";
16 } 18 }
17 19
18 class PluginDataRemoverTest : public InProcessBrowserTest, 20 class PluginDataRemoverTest : public InProcessBrowserTest,
19 public base::WaitableEventWatcher::Delegate { 21 public base::WaitableEventWatcher::Delegate {
20 public: 22 public:
21 PluginDataRemoverTest() : InProcessBrowserTest() { } 23 PluginDataRemoverTest() : InProcessBrowserTest() { }
22 24
23 virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event) { 25 virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event) {
24 MessageLoop::current()->Quit(); 26 MessageLoop::current()->Quit();
25 } 27 }
26 28
27 virtual void SetUpCommandLine(CommandLine* command_line) { 29 virtual void SetUpCommandLine(CommandLine* command_line) {
28 #ifdef OS_MACOSX 30 #ifdef OS_MACOSX
29 FilePath browser_directory; 31 FilePath browser_directory;
30 PathService::Get(base::DIR_MODULE, &browser_directory); 32 PathService::Get(base::DIR_MODULE, &browser_directory);
31 command_line->AppendSwitchPath(switches::kExtraPluginDir, 33 command_line->AppendSwitchPath(switches::kExtraPluginDir,
32 browser_directory.AppendASCII("plugins")); 34 browser_directory.AppendASCII("plugins"));
33 #endif 35 #endif
34 } 36 }
35 }; 37 };
36 38
37 IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, RemoveData) { 39 IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, RemoveData) {
38 PluginDataRemoverImpl plugin_data_remover(GetResourceContext()); 40 PluginDataRemoverImpl plugin_data_remover(GetBrowserContext());
39 plugin_data_remover.set_mime_type(kNPAPITestPluginMimeType); 41 plugin_data_remover.set_mime_type(kNPAPITestPluginMimeType);
40 base::WaitableEventWatcher watcher; 42 base::WaitableEventWatcher watcher;
41 base::WaitableEvent* event = 43 base::WaitableEvent* event =
42 plugin_data_remover.StartRemoving(base::Time()); 44 plugin_data_remover.StartRemoving(base::Time());
43 watcher.StartWatching(event, this); 45 watcher.StartWatching(event, this);
44 ui_test_utils::RunMessageLoop(); 46 ui_test_utils::RunMessageLoop();
45 } 47 }
48
49 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/browser/plugin_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698