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

Unified Diff: trunk/src/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc

Issue 23551005: Revert 219709 "Remove the Extensions URLRequestContext." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: trunk/src/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc
===================================================================
--- trunk/src/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc (revision 219785)
+++ trunk/src/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc (working copy)
@@ -7,7 +7,6 @@
#include "base/files/scoped_temp_dir.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
-#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/api/storage/leveldb_settings_storage_factory.h"
@@ -15,8 +14,7 @@
#include "chrome/browser/extensions/api/storage/settings_namespace.h"
#include "chrome/browser/extensions/api/storage/settings_test_util.h"
#include "chrome/browser/value_store/value_store.h"
-#include "content/public/browser/browser_thread.h"
-#include "content/public/test/test_browser_thread_bundle.h"
+#include "content/public/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
using content::BrowserThread;
@@ -54,7 +52,9 @@
class ExtensionSettingsFrontendTest : public testing::Test {
public:
ExtensionSettingsFrontendTest()
- : storage_factory_(new util::ScopedSettingsStorageFactory()) {}
+ : storage_factory_(new util::ScopedSettingsStorageFactory()),
+ ui_thread_(BrowserThread::UI, base::MessageLoop::current()),
+ file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {}
virtual void SetUp() OVERRIDE {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
@@ -66,7 +66,7 @@
frontend_.reset();
profile_.reset();
// Execute any pending deletion tasks.
- base::RunLoop().RunUntilIdle();
+ message_loop_.RunUntilIdle();
}
protected:
@@ -76,11 +76,15 @@
SettingsFrontend::Create(storage_factory_.get(), profile_.get()));
}
- content::TestBrowserThreadBundle thread_bundle_;
base::ScopedTempDir temp_dir_;
scoped_ptr<util::MockProfile> profile_;
scoped_ptr<SettingsFrontend> frontend_;
scoped_refptr<util::ScopedSettingsStorageFactory> storage_factory_;
+
+ private:
+ base::MessageLoop message_loop_;
+ content::TestBrowserThread ui_thread_;
+ content::TestBrowserThread file_thread_;
};
// Get a semblance of coverage for both extension and app settings by
@@ -137,7 +141,7 @@
// This would be triggered by extension uninstall via a DataDeleter.
frontend_->DeleteStorageSoon(id);
- base::RunLoop().RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
// The storage area may no longer be valid post-uninstall, so re-request.
storage = util::GetStorage(id, frontend_.get());
@@ -173,7 +177,7 @@
}
frontend_.reset();
- base::RunLoop().RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
// TODO(kalman): Figure out why this fails, despite appearing to work.
// Leaving this commented out rather than disabling the whole test so that the
// deletion code paths are at least exercised.
@@ -278,7 +282,7 @@
frontend_->RunWithStorage(
id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback));
- base::RunLoop().RunUntilIdle();
+ base::MessageLoop::current()->RunUntilIdle();
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698