| OLD | NEW |
| 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 "chrome/browser/plugin_data_remover.h" | 5 #include "chrome/browser/plugin_data_remover.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/synchronization/waitable_event_watcher.h" | 9 #include "base/synchronization/waitable_event_watcher.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 command_line->AppendSwitchPath(switches::kExtraPluginDir, | 49 command_line->AppendSwitchPath(switches::kExtraPluginDir, |
| 50 browser_directory.AppendASCII("plugins")); | 50 browser_directory.AppendASCII("plugins")); |
| 51 #endif | 51 #endif |
| 52 } | 52 } |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 std::string old_plugin_data_remover_mime_type_; | 55 std::string old_plugin_data_remover_mime_type_; |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, RemoveData) { | 58 IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, RemoveData) { |
| 59 scoped_refptr<PluginDataRemover> plugin_data_remover(new PluginDataRemover()); | 59 scoped_refptr<PluginDataRemover> plugin_data_remover( |
| 60 new PluginDataRemover(browser()->profile())); |
| 60 plugin_data_remover->set_mime_type(kNPAPITestPluginMimeType); | 61 plugin_data_remover->set_mime_type(kNPAPITestPluginMimeType); |
| 61 base::WaitableEventWatcher watcher; | 62 base::WaitableEventWatcher watcher; |
| 62 base::WaitableEvent* event = | 63 base::WaitableEvent* event = |
| 63 plugin_data_remover->StartRemoving(base::Time()); | 64 plugin_data_remover->StartRemoving(base::Time()); |
| 64 watcher.StartWatching(event, this); | 65 watcher.StartWatching(event, this); |
| 65 ui_test_utils::RunMessageLoop(); | 66 ui_test_utils::RunMessageLoop(); |
| 66 } | 67 } |
| 67 | 68 |
| 68 IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, AtShutdown) { | 69 IN_PROC_BROWSER_TEST_F(PluginDataRemoverTest, AtShutdown) { |
| 69 browser()->profile()->GetPrefs()->SetBoolean( | 70 browser()->profile()->GetPrefs()->SetBoolean( |
| 70 prefs::kClearSiteDataOnExit, true); | 71 prefs::kClearSiteDataOnExit, true); |
| 71 g_browser_process->local_state()->SetBoolean( | 72 g_browser_process->local_state()->SetBoolean( |
| 72 prefs::kClearPluginLSODataEnabled, true); | 73 prefs::kClearPluginLSODataEnabled, true); |
| 73 } | 74 } |
| OLD | NEW |