diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 18:31:54 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 18:31:54 +0000 |
commit | d8e682015deccd427d67145d17ca6eb78c090674 (patch) | |
tree | 692690ce8b6ad4245750dc2807790b79890993a8 /content/browser/plugin_data_remover_impl_browsertest.cc | |
parent | 4d87a94b75030786e356c3b4a25a06e9634a0012 (diff) | |
download | chromium_src-d8e682015deccd427d67145d17ca6eb78c090674.zip chromium_src-d8e682015deccd427d67145d17ca6eb78c090674.tar.gz chromium_src-d8e682015deccd427d67145d17ca6eb78c090674.tar.bz2 |
Move the PluginDataRemover class to content, and remove the chrome pieces from it. This class really belongs in content because it's part of the web platform. I've also wrapped it with an interface that is used by chrome.
BUG=98716
Review URL: http://codereview.chromium.org/8590016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110530 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/plugin_data_remover_impl_browsertest.cc')
-rw-r--r-- | content/browser/plugin_data_remover_impl_browsertest.cc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/content/browser/plugin_data_remover_impl_browsertest.cc b/content/browser/plugin_data_remover_impl_browsertest.cc new file mode 100644 index 0000000..c1689e3 --- /dev/null +++ b/content/browser/plugin_data_remover_impl_browsertest.cc @@ -0,0 +1,45 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/base_paths.h" +#include "base/command_line.h" +#include "base/path_service.h" +#include "base/synchronization/waitable_event_watcher.h" +#include "content/browser/plugin_data_remover_impl.h" +#include "content/public/common/content_switches.h" +#include "chrome/test/base/in_process_browser_test.h" +#include "chrome/test/base/ui_test_utils.h" + +namespace { +const char* kNPAPITestPluginMimeType = "application/vnd.npapi-test"; +} + +class PluginDataRemoverTest : public InProcessBrowserTest, + public base::WaitableEventWatcher::Delegate { + public: + PluginDataRemoverTest() : InProcessBrowserTest() { } + + virtual void OnWaitableEventSignaled(base::WaitableEvent* waitable_event) { + MessageLoop::current()->Quit(); + } + + virtual void SetUpCommandLine(CommandLine* command_line) { +#ifdef OS_MACOSX + FilePath browser_directory; + PathService::Get(base::DIR_MODULE, &browser_directory); + command_line->AppendSwitchPath(switches::kExtraPluginDir, + browser_directory.AppendASCII("plugins")); +#endif + } +}; + +IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, RemoveData) { + PluginDataRemoverImpl plugin_data_remover(GetResourceContext()); + plugin_data_remover.set_mime_type(kNPAPITestPluginMimeType); + base::WaitableEventWatcher watcher; + base::WaitableEvent* event = + plugin_data_remover.StartRemoving(base::Time()); + watcher.StartWatching(event, this); + ui_test_utils::RunMessageLoop(); +} |