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

Issue 5151418134560768: Adding first unit tests with mocks (Closed)

Created:
7 years, 5 months ago by vadimt
Modified:
7 years, 5 months ago
CC:
chromium-reviews, arv+watch_chromium.org
Visibility:
Public.

Description

Adding first unit tests to Google Now extension with mocks for global functions, chrome APIs and local callbacks. test_api.js framework was extended to support mocking non-global functions and APIs with dot-separated names. BUG=164227 TEST=No Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=211514

Patch Set 1 #

Total comments: 12

Patch Set 2 : arv@ notes #

Total comments: 22

Patch Set 3 : More arv@ notes #

Total comments: 2

Patch Set 4 : More arv@ notes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+485 lines, -0 lines) Patch
M chrome/browser/resources/google_now/background_test_util.js View 1 2 1 chunk +59 lines, -0 lines 0 comments Download
M chrome/browser/resources/google_now/background_unittest.gtestjs View 1 2 3 1 chunk +336 lines, -0 lines 0 comments Download
M chrome/test/data/webui/test_api.js View 1 2 4 chunks +90 lines, -0 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
vadimt
sky@, please provide OWNER's approval for chrome/test/data/webui/test_api.js arv@, please provide OWNER's approval for chrome/browser/resources/google_now/*
7 years, 5 months ago (2013-07-11 20:47:12 UTC) #1
arv (Not doing code reviews)
https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_test_util.js File chrome/browser/resources/google_now/background_test_util.js (right): https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_test_util.js#newcode53 chrome/browser/resources/google_now/background_test_util.js:53: this._expectedValue = expectedValue; Google3 style is to use trailing ...
7 years, 5 months ago (2013-07-11 20:59:44 UTC) #2
vadimt
https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_test_util.js File chrome/browser/resources/google_now/background_test_util.js (right): https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_test_util.js#newcode53 chrome/browser/resources/google_now/background_test_util.js:53: this._expectedValue = expectedValue; On 2013/07/11 20:59:44, arv wrote: > ...
7 years, 5 months ago (2013-07-11 21:28:10 UTC) #3
arv (Not doing code reviews)
https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_unittest.gtestjs File chrome/browser/resources/google_now/background_unittest.gtestjs (right): https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_unittest.gtestjs#newcode72 chrome/browser/resources/google_now/background_unittest.gtestjs:72: var storage_get_SavedArgs = new SaveMockArguments(); On 2013/07/11 21:28:10, vadimt ...
7 years, 5 months ago (2013-07-11 21:56:04 UTC) #4
vadimt
https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_unittest.gtestjs File chrome/browser/resources/google_now/background_unittest.gtestjs (right): https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_unittest.gtestjs#newcode72 chrome/browser/resources/google_now/background_unittest.gtestjs:72: var storage_get_SavedArgs = new SaveMockArguments(); On 2013/07/11 21:56:04, arv ...
7 years, 5 months ago (2013-07-11 22:18:24 UTC) #5
vadimt
sky@ if OOF jcivelli@, please provide OWNER's approval for chrome/test/data/webui/test_api.js
7 years, 5 months ago (2013-07-11 22:23:28 UTC) #6
Jay Civelli
On 2013/07/11 22:23:28, vadimt wrote: > sky@ if OOF > jcivelli@, please provide OWNER's approval ...
7 years, 5 months ago (2013-07-11 22:27:44 UTC) #7
vadimt
arv@ could you also review chrome/test/data/webui/test_api.js? jcivelli@, I assume that after arv@ looks at the ...
7 years, 5 months ago (2013-07-11 22:32:20 UTC) #8
arv (Not doing code reviews)
On 2013/07/11 22:18:24, vadimt wrote: > https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_unittest.gtestjs > File chrome/browser/resources/google_now/background_unittest.gtestjs (right): > > https://codereview.chromium.org/5151418134560768/diff/5629499534213120/chrome/browser/resources/google_now/background_unittest.gtestjs#newcode72 > ...
7 years, 5 months ago (2013-07-12 13:49:32 UTC) #9
arv (Not doing code reviews)
https://codereview.chromium.org/5151418134560768/diff/5865619656278016/chrome/browser/resources/google_now/background_test_util.js File chrome/browser/resources/google_now/background_test_util.js (right): https://codereview.chromium.org/5151418134560768/diff/5865619656278016/chrome/browser/resources/google_now/background_test_util.js#newcode64 chrome/browser/resources/google_now/background_test_util.js:64: return ( Or return JSON.stringify(this.expectedValue_) === JSON.stringify(actualArgument); https://codereview.chromium.org/5151418134560768/diff/5865619656278016/chrome/browser/resources/google_now/background_unittest.gtestjs File ...
7 years, 5 months ago (2013-07-12 14:18:33 UTC) #10
vadimt
arv@, thanks for also reviewing test_api.js! >> Why doesn't it mock out global.storage.get?... (I assume ...
7 years, 5 months ago (2013-07-12 18:22:35 UTC) #11
arv (Not doing code reviews)
https://codereview.chromium.org/5151418134560768/diff/18001/chrome/browser/resources/google_now/background_unittest.gtestjs File chrome/browser/resources/google_now/background_unittest.gtestjs (right): https://codereview.chromium.org/5151418134560768/diff/18001/chrome/browser/resources/google_now/background_unittest.gtestjs#newcode72 chrome/browser/resources/google_now/background_unittest.gtestjs:72: var storage_get_SavedArgs = new SaveMockArguments(); please fix local variable ...
7 years, 5 months ago (2013-07-12 18:36:52 UTC) #12
vadimt
https://codereview.chromium.org/5151418134560768/diff/18001/chrome/browser/resources/google_now/background_unittest.gtestjs File chrome/browser/resources/google_now/background_unittest.gtestjs (right): https://codereview.chromium.org/5151418134560768/diff/18001/chrome/browser/resources/google_now/background_unittest.gtestjs#newcode72 chrome/browser/resources/google_now/background_unittest.gtestjs:72: var storage_get_SavedArgs = new SaveMockArguments(); On 2013/07/12 18:36:52, arv ...
7 years, 5 months ago (2013-07-12 19:08:53 UTC) #13
arv (Not doing code reviews)
LGTM
7 years, 5 months ago (2013-07-12 19:12:36 UTC) #14
vadimt
Yey!!! Jay, could you review your part now?
7 years, 5 months ago (2013-07-12 19:16:51 UTC) #15
Jay Civelli
lgtm
7 years, 5 months ago (2013-07-12 21:48:32 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/vadimt@chromium.org/5151418134560768/24001
7 years, 5 months ago (2013-07-12 21:52:18 UTC) #17
commit-bot: I haz the power
7 years, 5 months ago (2013-07-13 03:02:48 UTC) #18
Message was sent while issue was closed.
Change committed as 211514

Powered by Google App Engine
This is Rietveld 408576698