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

Unified Diff: chrome/browser/resources/google_now/cards.js

Issue 121983002: Restoring recently deleted unit tests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rgustafson's notes Created 6 years, 11 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/resources/google_now/cards.js
diff --git a/chrome/browser/resources/google_now/cards.js b/chrome/browser/resources/google_now/cards.js
index 24df10b8354d3e94c4cbd32474a27a94b37af2cb..8f9c1c52c970062e45a14210cb398b8c98346e7e 100644
--- a/chrome/browser/resources/google_now/cards.js
+++ b/chrome/browser/resources/google_now/cards.js
@@ -113,9 +113,9 @@ function buildCardSet() {
/**
* Creates/updates/deletes a Chrome notification.
* @param {ChromeNotificationId} cardId Card ID.
- * @param {?ReceivedNotification} receivedNotification Google Now card
- * represented as a set of parameters for showing a Chrome notification,
- * or null if the notification needs to be deleted.
+ * @param {(ReceivedNotification|undefined)} receivedNotification Google Now
+ * card represented as a set of parameters for showing a Chrome
+ * notification, or null if the notification needs to be deleted.
* @param {function(ReceivedNotification)=} onCardShown Optional parameter
* called when each card is shown.
*/
@@ -195,8 +195,8 @@ function buildCardSet() {
chrome.alarms.clear(alarmPrefix + cardId);
var now = Date.now();
- /** @type {?UncombinedNotification} */
- var winningCard = null;
+ /** @type {(UncombinedNotification|undefined)} */
+ var winningCard = undefined;
// Next moment of time when winning notification selection algotithm can
// potentially return a different notification.
/** @type {?number} */
@@ -243,7 +243,7 @@ function buildCardSet() {
// otherwise notifications data with 2 pointers to the same object won't
// be stored correctly to chrome.storage.
var winningActionUrls = winningCard &&
- (winningCard.receivedNotification.actionUrls || null) &&
+ winningCard.receivedNotification.actionUrls &&
JSON.parse(JSON.stringify(
winningCard.receivedNotification.actionUrls));

Powered by Google App Engine
This is Rietveld 408576698