| 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/common/pref_names.h" | 5 #include "chrome/common/pref_names.h" |
| 6 #include "chrome/browser/prefs/pref_service.h" | 6 #include "chrome/browser/prefs/pref_service.h" |
| 7 #include "chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h" | 7 #include "chrome/browser/ui/tab_contents/per_tab_prefs_tab_helper.h" |
| 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 8 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 9 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" | 9 #include "chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h" |
| 10 #include "content/browser/tab_contents/test_tab_contents.h" | 10 #include "content/browser/tab_contents/test_tab_contents.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 prefs2->SetBoolean(key, !initial_value); | 91 prefs2->SetBoolean(key, !initial_value); |
| 92 EXPECT_EQ(initial_value, prefs1->GetBoolean(key)); | 92 EXPECT_EQ(initial_value, prefs1->GetBoolean(key)); |
| 93 EXPECT_EQ(!initial_value, prefs2->GetBoolean(key)); | 93 EXPECT_EQ(!initial_value, prefs2->GetBoolean(key)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 TEST_F(PerTabPrefsTabHelperTest, OverridePrefsOnViewCreation) { | 96 TEST_F(PerTabPrefsTabHelperTest, OverridePrefsOnViewCreation) { |
| 97 TestPerTabPrefsTabHelper* test_prefs_helper = new TestPerTabPrefsTabHelper( | 97 TestPerTabPrefsTabHelper* test_prefs_helper = new TestPerTabPrefsTabHelper( |
| 98 contents_wrapper()); | 98 contents_wrapper()); |
| 99 contents_wrapper()->per_tab_prefs_tab_helper_.reset(test_prefs_helper); | 99 contents_wrapper()->per_tab_prefs_tab_helper_.reset(test_prefs_helper); |
| 100 EXPECT_EQ(false, test_prefs_helper->was_override_web_prefernces_called()); | 100 EXPECT_FALSE(test_prefs_helper->was_override_web_prefernces_called()); |
| 101 test_prefs_helper->NotifyRenderViewCreated(); | 101 test_prefs_helper->NotifyRenderViewCreated(); |
| 102 EXPECT_EQ(true, test_prefs_helper->was_override_web_prefernces_called()); | 102 EXPECT_TRUE(test_prefs_helper->was_override_web_prefernces_called()); |
| 103 } | 103 } |
| OLD | NEW |