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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/scoped_temp_dir.h" | 11 #include "base/scoped_temp_dir.h" |
12 #include "chrome/browser/extensions/extension_settings_backend.h" | 12 #include "chrome/browser/extensions/extension_settings_backend.h" |
13 #include "chrome/browser/extensions/extension_settings_frontend.h" | 13 #include "chrome/browser/extensions/extension_settings_frontend.h" |
14 #include "chrome/browser/extensions/extension_settings_storage.h" | 14 #include "chrome/browser/extensions/extension_settings_storage.h" |
15 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
16 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
17 #include "content/test/test_browser_thread.h" | 17 #include "content/test/test_browser_thread.h" |
18 | 18 |
| 19 using content::BrowserThread; |
| 20 |
19 class ExtensionSettingsFrontendTest : public testing::Test { | 21 class ExtensionSettingsFrontendTest : public testing::Test { |
20 public: | 22 public: |
21 ExtensionSettingsFrontendTest() | 23 ExtensionSettingsFrontendTest() |
22 : ui_thread_(BrowserThread::UI, MessageLoop::current()), | 24 : ui_thread_(BrowserThread::UI, MessageLoop::current()), |
23 file_thread_(BrowserThread::FILE, MessageLoop::current()) {} | 25 file_thread_(BrowserThread::FILE, MessageLoop::current()) {} |
24 | 26 |
25 virtual void SetUp() OVERRIDE { | 27 virtual void SetUp() OVERRIDE { |
26 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 28 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
27 profile_.reset(new TestingProfile(temp_dir_.path())); | 29 profile_.reset(new TestingProfile(temp_dir_.path())); |
28 frontend_.reset(new ExtensionSettingsFrontend(profile_.get())); | 30 frontend_.reset(new ExtensionSettingsFrontend(profile_.get())); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 ASSERT_FALSE(result.HasError()); | 128 ASSERT_FALSE(result.HasError()); |
127 EXPECT_TRUE(file_util::PathExists(temp_dir_.path())); | 129 EXPECT_TRUE(file_util::PathExists(temp_dir_.path())); |
128 | 130 |
129 frontend_.reset(); | 131 frontend_.reset(); |
130 MessageLoop::current()->RunAllPending(); | 132 MessageLoop::current()->RunAllPending(); |
131 // TODO(kalman): Figure out why this fails, despite appearing to work. | 133 // TODO(kalman): Figure out why this fails, despite appearing to work. |
132 // Leaving this commented out rather than disabling the whole test so that the | 134 // Leaving this commented out rather than disabling the whole test so that the |
133 // deletion code paths are at least exercised. | 135 // deletion code paths are at least exercised. |
134 //EXPECT_FALSE(file_util::PathExists(temp_dir_.path())); | 136 //EXPECT_FALSE(file_util::PathExists(temp_dir_.path())); |
135 } | 137 } |
OLD | NEW |