From cea5e4f176b0cbee7e1e2df373ebe48b850490c6 Mon Sep 17 00:00:00 2001 From: "thakis@chromium.org" Date: Fri, 10 Sep 2010 21:37:49 +0000 Subject: Fix gcc 4.2 warning in unit test. As seen at http://build.chromium.org/buildbot/try-server/builders/mac/builds/45974/steps/compile/logs/stdio : warning: 'PluginExceptionsTableModelTest' has a field 'PluginExceptionsTableModelTest::table_model_' whose type uses the anonymous namespace The fix for that is to move the test into the anonymous namespace too, which breaks the friend declaration. So I need to work around that, too. BUG=none TEST=none Review URL: http://codereview.chromium.org/3345019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59155 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/plugin_exceptions_table_model.h | 5 ++++- chrome/browser/plugin_exceptions_table_model_unittest.cc | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/plugin_exceptions_table_model.h b/chrome/browser/plugin_exceptions_table_model.h index 8732a0d..e0cbc18 100644 --- a/chrome/browser/plugin_exceptions_table_model.h +++ b/chrome/browser/plugin_exceptions_table_model.h @@ -12,6 +12,9 @@ #include "chrome/browser/host_content_settings_map.h" #include "chrome/common/notification_observer.h" +namespace plugin_test_internal { +class PluginExceptionsTableModelTest; +} struct WebPluginInfo; class PluginExceptionsTableModel : public RemoveRowsTableModel, @@ -48,7 +51,7 @@ class PluginExceptionsTableModel : public RemoveRowsTableModel, virtual void GetPlugins(std::vector* plugins); private: - friend class PluginExceptionsTableModelTest; + friend class plugin_test_internal::PluginExceptionsTableModelTest; struct SettingsEntry { HostContentSettingsMap::Pattern pattern; diff --git a/chrome/browser/plugin_exceptions_table_model_unittest.cc b/chrome/browser/plugin_exceptions_table_model_unittest.cc index 09eac8a..7720287 100644 --- a/chrome/browser/plugin_exceptions_table_model_unittest.cc +++ b/chrome/browser/plugin_exceptions_table_model_unittest.cc @@ -14,7 +14,9 @@ #include "testing/gtest/include/gtest/gtest.h" #include "webkit/glue/plugins/webplugininfo.h" -namespace { +// Can't be an internal namespace because PluginExceptionsTableModel declares +// as a friend. +namespace plugin_test_internal { class MockTableModelObserver : public TableModelObserver { public: @@ -44,8 +46,6 @@ class TestingPluginExceptionsTableModel : public PluginExceptionsTableModel { std::vector plugins_; }; -} - class PluginExceptionsTableModelTest : public testing::Test { public: PluginExceptionsTableModelTest() @@ -75,9 +75,7 @@ class PluginExceptionsTableModelTest : public testing::Test { "bar", CONTENT_SETTING_ALLOW); - table_model_.reset(new TestingPluginExceptionsTableModel( - map, - NULL)); + table_model_.reset(new TestingPluginExceptionsTableModel(map, NULL)); std::vector plugins; WebPluginInfo foo_plugin; @@ -188,3 +186,5 @@ TEST_F(PluginExceptionsTableModelTest, RemoveAllRows) { CheckInvariants(); table_model_->SetObserver(NULL); } + +} // namespace plugin_test_internal -- cgit v1.1