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

Unified Diff: chrome/browser/resources/google_now/background_unittest.gtestjs

Issue 23128005: Bring windows with new tabs to foreground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing unit tests. 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
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/background_unittest.gtestjs
diff --git a/chrome/browser/resources/google_now/background_unittest.gtestjs b/chrome/browser/resources/google_now/background_unittest.gtestjs
index 64c799ed64681bb4582ebefd79725ddb6c435263..73712fb8241bbbac44ba6911b6d4ffe610f2f185 100644
--- a/chrome/browser/resources/google_now/background_unittest.gtestjs
+++ b/chrome/browser/resources/google_now/background_unittest.gtestjs
@@ -380,6 +380,7 @@ TEST_F('GoogleNowBackgroundUnitTest', 'Initialize_NoGeolocation', function() {
function mockOnNotificationClickedDependencies(fixture) {
fixture.makeAndRegisterMockApis([
'chrome.windows.create',
+ 'chrome.windows.update',
'instrumented.storage.local.get',
'instrumented.tabs.create']);
}
@@ -486,7 +487,7 @@ TEST_F(
notificationsData: {'TEST_ID': {actionUrls: testActionUrls}}
};
var testActionUrl = 'http://testurl.com';
- var testCreatedTab = {};
+ var testCreatedTab = {windowId: 239};
mockOnNotificationClickedDependencies(this);
this.makeMockLocalFunctions(['selector']);
@@ -505,6 +506,9 @@ TEST_F(
chromeTabsCreateSavedArgs.match(eqJSON({url: testActionUrl})),
chromeTabsCreateSavedArgs.match(ANYTHING)).
will(invokeCallback(chromeTabsCreateSavedArgs, 1, testCreatedTab));
+ this.mockApis.expects(once()).chrome_windows_update(
+ testCreatedTab.windowId,
+ eqJSON({focused: true}));
// Invoking the tested function.
onNotificationClicked(
@@ -546,7 +550,7 @@ TEST_F(
chromeTabsCreateSavedArgs.match(ANYTHING)).
will(invokeCallback(chromeTabsCreateSavedArgs, 1, testCreatedTab));
this.mockApis.expects(once()).chrome_windows_create(
- eqJSON({url: testActionUrl}));
+ eqJSON({url: testActionUrl, focused: true}));
// Invoking the tested function.
onNotificationClicked(
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698