diff options
author | scottbyer@google.com <scottbyer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 19:11:30 +0000 |
---|---|---|
committer | scottbyer@google.com <scottbyer@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-16 19:11:30 +0000 |
commit | 8441eb0eb35a2351285e1a856ccc8ff2f0db7d56 (patch) | |
tree | 02d2a460c02b832d4c40af57d2054ed529f92a3c /chrome/browser/plugin_service_unittest.cc | |
parent | cffcdd5483f373dc38b2bb28fb3f59d881a68b80 (diff) | |
download | chromium_src-8441eb0eb35a2351285e1a856ccc8ff2f0db7d56.zip chromium_src-8441eb0eb35a2351285e1a856ccc8ff2f0db7d56.tar.gz chromium_src-8441eb0eb35a2351285e1a856ccc8ff2f0db7d56.tar.bz2 |
Revert 66288 - Implemented unit tests for the public members of the PluginService class.
BUG=none
TEST=browser_tests,unit_tests
Review URL: http://codereview.chromium.org/4525004
Patch from Yulian Pastarmov <pastarmovj@google.com>.
TBR=jochen@chromium.org
Review URL: http://codereview.chromium.org/5084004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66305 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_service_unittest.cc')
-rw-r--r-- | chrome/browser/plugin_service_unittest.cc | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/chrome/browser/plugin_service_unittest.cc b/chrome/browser/plugin_service_unittest.cc deleted file mode 100644 index 69172598..0000000 --- a/chrome/browser/plugin_service_unittest.cc +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2010 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 "chrome/browser/plugin_service.h" - -#include "base/auto_reset.h" -#include "base/command_line.h" -#include "chrome/browser/browser_thread.h" -#include "chrome/test/testing_profile.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "webkit/glue/plugins/plugin_list.h" - -namespace { - -class PluginServiceTest : public testing::Test { - public: - PluginServiceTest() - : message_loop_(MessageLoop::TYPE_IO), - ui_thread_(BrowserThread::UI, &message_loop_), - file_thread_(BrowserThread::FILE, &message_loop_), - io_thread_(BrowserThread::IO, &message_loop_) {} - - virtual ~PluginServiceTest() {} - - virtual void SetUp() { - profile_.reset(new TestingProfile()); - - PluginService::InitGlobalInstance(profile_.get()); - plugin_service_ = PluginService::GetInstance(); - ASSERT_TRUE(plugin_service_); - } - - protected: - MessageLoop message_loop_; - PluginService* plugin_service_; - - private: - BrowserThread ui_thread_; - BrowserThread file_thread_; - BrowserThread io_thread_; - scoped_ptr<TestingProfile> profile_; - - DISALLOW_COPY_AND_ASSIGN(PluginServiceTest); -}; - -TEST_F(PluginServiceTest, SetGetChromePluginDataDir) { - // Check that after setting the same plugin dir we just read it is set - // correctly. - FilePath plugin_data_dir = plugin_service_->GetChromePluginDataDir(); - FilePath new_plugin_data_dir(FILE_PATH_LITERAL("/a/bogus/dir")); - plugin_service_->SetChromePluginDataDir(new_plugin_data_dir); - EXPECT_EQ(new_plugin_data_dir, plugin_service_->GetChromePluginDataDir()); - plugin_service_->SetChromePluginDataDir(plugin_data_dir); - EXPECT_EQ(plugin_data_dir, plugin_service_->GetChromePluginDataDir()); -} - -TEST_F(PluginServiceTest, GetUILocale) { - // Check for a non-empty locale string. - EXPECT_NE("", plugin_service_->GetUILocale()); -} - -TEST_F(PluginServiceTest, GetFirstAllowedPluginInfo) { - // We should always get a positive response no matter whether we really have - // a plugin to support that particular mime type because the Default plugin - // supports all mime types. - WebPluginInfo plugin_info; - std::string plugin_mime_type; - plugin_service_->GetFirstAllowedPluginInfo(GURL("http://google.com/"), - "application/pdf", - &plugin_info, - &plugin_mime_type); - EXPECT_EQ("application/pdf", plugin_mime_type); -} - -} // namespace |