This source file includes following definitions.
- TEST
#include "content/child/npapi/plugin_lib.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace content {
class PluginLibTest : public PluginLib {
public:
PluginLibTest() : PluginLib(WebPluginInfo()) {}
using PluginLib::Unload;
protected:
virtual ~PluginLibTest() {}
};
TEST(PluginLibLoading, UnloadAllPlugins) {
ASSERT_EQ(static_cast<PluginLibTest*>(NULL),
PluginLibTest::CreatePluginLib(base::FilePath()));
scoped_refptr<PluginLibTest> plugin_lib1(new PluginLibTest());
PluginLib::UnloadAllPlugins();
ASSERT_EQ(static_cast<PluginLibTest*>(NULL),
PluginLibTest::CreatePluginLib(base::FilePath()));
plugin_lib1 = new PluginLibTest();
scoped_refptr<PluginLibTest> plugin_lib2(new PluginLibTest());
PluginLib::UnloadAllPlugins();
ASSERT_EQ(static_cast<PluginLibTest*>(NULL),
PluginLibTest::CreatePluginLib(base::FilePath()));
plugin_lib1 = new PluginLibTest();
plugin_lib2 = new PluginLibTest();
plugin_lib1->Unload();
PluginLib::UnloadAllPlugins();
ASSERT_EQ(static_cast<PluginLibTest*>(NULL),
PluginLibTest::CreatePluginLib(base::FilePath()));
plugin_lib1 = new PluginLibTest();
plugin_lib1->Unload();
PluginLib::UnloadAllPlugins();
}
}