Index: chrome/browser/printing/print_dialog_cloud_unittest.cc |
diff --git a/chrome/browser/printing/print_dialog_cloud_unittest.cc b/chrome/browser/printing/print_dialog_cloud_unittest.cc |
index c08ffa88b4e86a695b4af7504007d7e55b859b85..4b4e9a8586c8534f9bf893254e1fa6e018c59378 100644 |
--- a/chrome/browser/printing/print_dialog_cloud_unittest.cc |
+++ b/chrome/browser/printing/print_dialog_cloud_unittest.cc |
@@ -22,10 +22,11 @@ |
#include "chrome/common/chrome_paths.h" |
#include "chrome/common/url_constants.h" |
#include "chrome/test/base/testing_profile.h" |
+#include "content/public/browser/browser_thread.h" |
#include "content/public/browser/notification_details.h" |
#include "content/public/browser/notification_source.h" |
#include "content/public/browser/notification_types.h" |
-#include "content/public/test/test_browser_thread.h" |
+#include "content/public/test/test_browser_thread_bundle.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
@@ -148,26 +149,20 @@ class MockCloudPrintDataSenderHelper : public CloudPrintDataSenderHelper { |
}; |
class CloudPrintURLTest : public testing::Test { |
- public: |
- CloudPrintURLTest() {} |
- |
protected: |
- virtual void SetUp() { |
- profile_.reset(new TestingProfile()); |
- } |
- |
- scoped_ptr<Profile> profile_; |
+ content::TestBrowserThreadBundle thread_bundle_; |
+ TestingProfile profile_; |
}; |
TEST_F(CloudPrintURLTest, CheckDefaultURLs) { |
std::string service_url = |
- CloudPrintURL(profile_.get()). |
+ CloudPrintURL(&profile_). |
GetCloudPrintServiceURL().spec(); |
EXPECT_THAT(service_url, HasSubstr("www.google.com")); |
EXPECT_THAT(service_url, HasSubstr("cloudprint")); |
std::string dialog_url = |
- CloudPrintURL(profile_.get()). |
+ CloudPrintURL(&profile_). |
GetCloudPrintServiceDialogURL().spec(); |
EXPECT_THAT(dialog_url, HasSubstr("www.google.com")); |
EXPECT_THAT(dialog_url, HasSubstr("/cloudprint/")); |
@@ -177,7 +172,7 @@ TEST_F(CloudPrintURLTest, CheckDefaultURLs) { |
// Repeat to make sure there isn't a transient glitch. |
dialog_url = |
- CloudPrintURL(profile_.get()). |
+ CloudPrintURL(&profile_). |
GetCloudPrintServiceDialogURL().spec(); |
EXPECT_THAT(dialog_url, HasSubstr("www.google.com")); |
EXPECT_THAT(dialog_url, HasSubstr("/cloudprint/")); |
@@ -186,7 +181,7 @@ TEST_F(CloudPrintURLTest, CheckDefaultURLs) { |
EXPECT_THAT(dialog_url, HasSubstr("/dialog.html")); |
std::string manage_url = |
- CloudPrintURL(profile_.get()). |
+ CloudPrintURL(&profile_). |
GetCloudPrintServiceManageURL().spec(); |
EXPECT_THAT(manage_url, HasSubstr("www.google.com")); |
EXPECT_THAT(manage_url, HasSubstr("/cloudprint/")); |
@@ -213,11 +208,6 @@ TEST_F(CloudPrintURLTest, CheckDefaultURLs) { |
// Testing for CloudPrintDataSender needs a mock WebUI. |
class CloudPrintDataSenderTest : public testing::Test { |
- public: |
- CloudPrintDataSenderTest() |
- : file_thread_(BrowserThread::FILE, &message_loop_), |
- io_thread_(BrowserThread::IO, &message_loop_) {} |
- |
protected: |
virtual void SetUp() { |
mock_helper_.reset(new MockCloudPrintDataSenderHelper); |
@@ -235,9 +225,7 @@ class CloudPrintDataSenderTest : public testing::Test { |
scoped_refptr<CloudPrintDataSender> print_data_sender_; |
scoped_ptr<MockCloudPrintDataSenderHelper> mock_helper_; |
- base::MessageLoop message_loop_; |
- content::TestBrowserThread file_thread_; |
- content::TestBrowserThread io_thread_; |
+ content::TestBrowserThreadBundle thread_bundle_; |
}; |
TEST_F(CloudPrintDataSenderTest, CanSend) { |
@@ -291,10 +279,6 @@ using internal_cloud_print_helpers::MockCloudPrintFlowHandler; |
using internal_cloud_print_helpers::CloudPrintWebDialogDelegate; |
class CloudPrintWebDialogDelegateTest : public testing::Test { |
- public: |
- CloudPrintWebDialogDelegateTest() |
- : ui_thread_(BrowserThread::UI, &message_loop_) {} |
- |
protected: |
virtual void SetUp() { |
string16 mock_title; |
@@ -316,8 +300,7 @@ class CloudPrintWebDialogDelegateTest : public testing::Test { |
delete mock_flow_handler_.get(); |
} |
- base::MessageLoopForUI message_loop_; |
- content::TestBrowserThread ui_thread_; |
+ content::TestBrowserThreadBundle thread_bundle_; |
base::WeakPtr<MockCloudPrintFlowHandler> mock_flow_handler_; |
scoped_ptr<CloudPrintWebDialogDelegate> delegate_; |
}; |