OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/content_exceptions_table_model.h" | 5 #include "chrome/browser/content_exceptions_table_model.h" |
6 | 6 |
7 #include "chrome/test/testing_profile.h" | 7 #include "chrome/test/testing_profile.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 class ContentExceptionsTableModelTest : public testing::Test { | 12 class ContentExceptionsTableModelTest : public testing::Test { |
13 public: | 13 public: |
14 ContentExceptionsTableModelTest() | 14 ContentExceptionsTableModelTest() |
15 : ui_thread_(BrowserThread::UI, &message_loop_) {} | 15 : ui_thread_(BrowserThread::UI, &message_loop_) {} |
16 | 16 |
17 protected: | 17 protected: |
18 MessageLoop message_loop_; | 18 MessageLoop message_loop_; |
19 BrowserThread ui_thread_; | 19 BrowserThread ui_thread_; |
20 }; | 20 }; |
21 | 21 |
22 TEST_F(ContentExceptionsTableModelTest, Incognito) { | 22 TEST_F(ContentExceptionsTableModelTest, Incognito) { |
23 TestingProfile profile; | 23 TestingProfile profile; |
24 TestingProfile* otr_profile = new TestingProfile(); | 24 TestingProfile* otr_profile = new TestingProfile(); |
Paweł Hajdan Jr.
2011/02/04 07:26:28
nit: Can it be stack-allocated now?
markusheintz_
2011/02/04 10:08:03
Sure. Don't see why not.
DONE.
| |
25 otr_profile->set_off_the_record(true); | 25 otr_profile->set_off_the_record(true); |
26 ContentExceptionsTableModel model(profile.GetHostContentSettingsMap(), | 26 ContentExceptionsTableModel model(profile.GetHostContentSettingsMap(), |
27 otr_profile->GetHostContentSettingsMap(), | 27 otr_profile->GetHostContentSettingsMap(), |
28 CONTENT_SETTINGS_TYPE_COOKIES); | 28 CONTENT_SETTINGS_TYPE_COOKIES); |
29 delete otr_profile; | |
30 model.AddException(ContentSettingsPattern("example.com"), | 29 model.AddException(ContentSettingsPattern("example.com"), |
31 CONTENT_SETTING_BLOCK, true); | 30 CONTENT_SETTING_BLOCK, true); |
31 delete otr_profile; | |
32 } | 32 } |
33 | 33 |
34 } // namespace | 34 } // namespace |
OLD | NEW |