Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(50)

Side by Side Diff: chrome/browser/plugin_exceptions_table_model_unittest.cc

Issue 7465041: GTTF: Use a fresh TestingBrowserProcess for each test, part #4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "base/auto_reset.h" 5 #include "base/auto_reset.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/mock_plugin_exceptions_table_model.h" 8 #include "chrome/browser/mock_plugin_exceptions_table_model.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/test/base/testing_pref_service.h" 10 #include "chrome/test/base/testing_pref_service.h"
11 #include "chrome/test/base/testing_profile.h" 11 #include "chrome/test/base/testing_profile.h"
12 #include "chrome/test/testing_browser_process_test.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 #include "ui/base/models/table_model_observer.h" 15 #include "ui/base/models/table_model_observer.h"
15 #include "webkit/plugins/npapi/plugin_group.h" 16 #include "webkit/plugins/npapi/plugin_group.h"
16 #include "webkit/plugins/npapi/webplugininfo.h" 17 #include "webkit/plugins/npapi/webplugininfo.h"
17 18
18 // Can't be an internal namespace because PluginExceptionsTableModel declares 19 // Can't be an internal namespace because PluginExceptionsTableModel declares
19 // as a friend. 20 // as a friend.
20 namespace plugin_test_internal { 21 namespace plugin_test_internal {
21 22
(...skipping 23 matching lines...) Expand all
45 EXPECT_LT(start, model_->RowCount() + 1); 46 EXPECT_LT(start, model_->RowCount() + 1);
46 } 47 }
47 48
48 ui::TableModel* model_; 49 ui::TableModel* model_;
49 }; 50 };
50 51
51 } // namespace plugin_test_internal 52 } // namespace plugin_test_internal
52 53
53 using ::testing::InSequence; 54 using ::testing::InSequence;
54 55
55 class PluginExceptionsTableModelTest : public testing::Test { 56 class PluginExceptionsTableModelTest : public TestingBrowserProcessTest {
56 public: 57 public:
57 PluginExceptionsTableModelTest() 58 PluginExceptionsTableModelTest()
58 : ui_thread_(BrowserThread::UI, &message_loop_), 59 : ui_thread_(BrowserThread::UI, &message_loop_),
59 command_line_(CommandLine::ForCurrentProcess(), 60 command_line_(CommandLine::ForCurrentProcess(),
60 *CommandLine::ForCurrentProcess()) {} 61 *CommandLine::ForCurrentProcess()) {}
61 62
62 virtual void SetUp() { 63 virtual void SetUp() {
63 CommandLine::ForCurrentProcess()->AppendSwitch( 64 CommandLine::ForCurrentProcess()->AppendSwitch(
64 switches::kEnableResourceContentSettings); 65 switches::kEnableResourceContentSettings);
65 66
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 plugin_test_internal::MockTableModelObserver observer(table_model_.get()); 216 plugin_test_internal::MockTableModelObserver observer(table_model_.get());
216 table_model_->SetObserver(&observer); 217 table_model_->SetObserver(&observer);
217 218
218 EXPECT_CALL(observer, OnModelChanged()); 219 EXPECT_CALL(observer, OnModelChanged());
219 table_model_->RemoveAll(); 220 table_model_->RemoveAll();
220 EXPECT_EQ(0, table_model_->RowCount()); 221 EXPECT_EQ(0, table_model_->RowCount());
221 EXPECT_EQ(0, static_cast<int>(table_model_->GetGroups().size())); 222 EXPECT_EQ(0, static_cast<int>(table_model_->GetGroups().size()));
222 CheckInvariants(); 223 CheckInvariants();
223 table_model_->SetObserver(NULL); 224 table_model_->SetObserver(NULL);
224 } 225 }
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_store_x_unittest.cc ('k') | chrome/browser/policy/cloud_policy_subsystem_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698