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

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

Issue 10834203: Integrate invalidation API into ChromeToMobileService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment; sync and rebase. 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
diff --git a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
index c1efcb27c6949562d5d6d85d19bfbe6ec5fd93f6..534a42f2e5f184b497ddc95bb1c9fc302ccb68ef 100644
--- a/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/chrome_to_mobile_bubble_controller_unittest.mm
@@ -19,10 +19,9 @@ class MockChromeToMobileService : public ChromeToMobileService {
// 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));
@@ -36,7 +35,9 @@ class MockChromeToMobileService : public ChromeToMobileService {
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);
}
}
@@ -115,8 +116,9 @@ class ChromeToMobileBubbleControllerTest : public CocoaTest {
};
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));
@@ -126,8 +128,9 @@ TEST_F(ChromeToMobileBubbleControllerTest, OneDevice) {
}
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));
@@ -137,8 +140,9 @@ TEST_F(ChromeToMobileBubbleControllerTest, TwoDevices) {
}
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));
@@ -149,7 +153,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, ThreeDevices) {
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::_));
@@ -162,7 +165,6 @@ TEST_F(ChromeToMobileBubbleControllerTest, SendWithoutSnapshot) {
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