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

Unified Diff: chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm

Issue 10861038: Revert 152609 - Integrate invalidation API into ChromeToMobileService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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: chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
===================================================================
--- chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm (revision 152612)
+++ chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm (working copy)
@@ -19,9 +19,10 @@
// ChromeToMobileService overrides:
virtual const base::ListValue* GetMobiles() const OVERRIDE;
+ MOCK_METHOD0(RequestMobileListUpdate, void());
MOCK_METHOD2(GenerateSnapshot, void(Browser* browser,
base::WeakPtr<Observer> observer));
- MOCK_METHOD4(SendToMobile, void(const base::DictionaryValue* mobile,
+ MOCK_METHOD4(SendToMobile, void(const base::DictionaryValue& mobile,
const FilePath& snapshot,
Browser* browser,
base::WeakPtr<Observer> observer));
@@ -35,9 +36,7 @@
void MockChromeToMobileService::AddDevices(size_t count) {
for(size_t i = 0; i < count; i++) {
base::DictionaryValue* device = new base::DictionaryValue();
- device->SetString("type", "Device Type");
device->SetString("name", "Device Name");
- device->SetString("id", "Device ID");
mobiles_.Append(device);
}
}
@@ -116,9 +115,8 @@
};
TEST_F(ChromeToMobileBubbleControllerTest, OneDevice) {
+ EXPECT_CALL(service_, RequestMobileListUpdate());
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
- EXPECT_CALL(service_, SendToMobile(testing::_, testing::_,
- testing::_, testing::_)).Times(0);
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
@@ -128,9 +126,8 @@
}
TEST_F(ChromeToMobileBubbleControllerTest, TwoDevices) {
+ EXPECT_CALL(service_, RequestMobileListUpdate());
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
- EXPECT_CALL(service_, SendToMobile(testing::_, testing::_,
- testing::_, testing::_)).Times(0);
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
@@ -140,9 +137,8 @@
}
TEST_F(ChromeToMobileBubbleControllerTest, ThreeDevices) {
+ EXPECT_CALL(service_, RequestMobileListUpdate());
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
- EXPECT_CALL(service_, SendToMobile(testing::_, testing::_,
- testing::_, testing::_)).Times(0);
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
EXPECT_CALL(service_, LogMetric(ChromeToMobileService::BUBBLE_SHOWN));
@@ -153,6 +149,7 @@
TEST_F(ChromeToMobileBubbleControllerTest, SendWithoutSnapshot) {
FilePath path;
+ EXPECT_CALL(service_, RequestMobileListUpdate());
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
EXPECT_CALL(service_, SendToMobile(testing::_, path, NULL, testing::_));
EXPECT_CALL(service_, DeleteSnapshot(testing::_));
@@ -165,6 +162,7 @@
TEST_F(ChromeToMobileBubbleControllerTest, SendWithSnapshot) {
FilePath path("path.mht");
+ EXPECT_CALL(service_, RequestMobileListUpdate());
EXPECT_CALL(service_, GenerateSnapshot(NULL, testing::_));
EXPECT_CALL(service_, SendToMobile(testing::_, path, NULL, testing::_));
EXPECT_CALL(service_, DeleteSnapshot(testing::_));

Powered by Google App Engine
This is Rietveld 408576698