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

Issue 399363002: Add support for writing unit tests for Mojo-backed apps/extensions APIs. (Closed)

Created:
6 years, 5 months ago by Sam McNally
Modified:
6 years, 5 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, extensions-reviews_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add support for writing unit tests for Mojo-backed apps/extensions APIs. This change adds the infrastructure for unit testing the JS parts of apps and extensions APIs implemented on top of Mojo services. The test environment provides a partial implementation of the JS test API provided to browser tests. A TestServiceProvider implementation is used to provide test implementations of the appropriate Mojo services to the JS code. BUG=389016 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=285792

Patch Set 1 : #

Total comments: 14

Patch Set 2 : address comments #

Total comments: 4

Patch Set 3 : rebase #

Patch Set 4 : address comments #

Patch Set 5 : rebase #

Total comments: 4

Patch Set 6 : rebase #

Patch Set 7 : address comments #

Total comments: 1

Patch Set 8 : rebase #

Patch Set 9 : buffer.js #

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+724 lines, -123 lines) Patch
M extensions/DEPS View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/extensions.gyp View 1 2 3 4 5 6 7 5 chunks +12 lines, -0 lines 0 comments Download
M extensions/renderer/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A extensions/renderer/api_test_base.h View 1 2 3 1 chunk +94 lines, -0 lines 0 comments Download
A extensions/renderer/api_test_base.cc View 1 2 3 4 5 6 1 chunk +221 lines, -0 lines 0 comments Download
A extensions/renderer/api_test_base_unittest.cc View 1 2 3 4 5 6 1 chunk +34 lines, -0 lines 0 comments Download
M extensions/renderer/dispatcher.h View 1 2 3 4 5 6 2 chunks +10 lines, -0 lines 0 comments Download
M extensions/renderer/dispatcher.cc View 1 2 3 4 5 6 7 8 4 chunks +157 lines, -108 lines 0 comments Download
M extensions/renderer/module_system.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M extensions/renderer/module_system_test.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
A extensions/renderer/resources/browser_test_environment_specific_bindings.js View 1 2 3 4 5 6 1 chunk +15 lines, -0 lines 0 comments Download
M extensions/renderer/resources/extensions_renderer_resources.grd View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M extensions/renderer/resources/test_custom_bindings.js View 1 2 3 4 5 6 4 chunks +5 lines, -6 lines 0 comments Download
M extensions/renderer/script_context.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
A extensions/test/DEPS View 1 1 chunk +3 lines, -0 lines 0 comments Download
A extensions/test/data/api_test_base_unittest.js View 1 2 3 4 5 6 1 chunk +65 lines, -0 lines 0 comments Download
A extensions/test/data/unit_test_environment_specific_bindings.js View 1 2 3 4 5 6 1 chunk +50 lines, -0 lines 0 comments Download
M extensions/test/extensions_unittests_main.cc View 1 2 3 4 5 6 7 2 chunks +2 lines, -0 lines 0 comments Download
M extensions/test/test_extensions_client.cc View 1 2 3 4 5 6 3 chunks +46 lines, -6 lines 0 comments Download

Messages

Total messages: 21 (0 generated)
Sam McNally
6 years, 5 months ago (2014-07-18 08:27:52 UTC) #1
not at google - send to devlin
https://codereview.chromium.org/399363002/diff/60001/extensions/renderer/api_test_base.cc File extensions/renderer/api_test_base.cc (right): https://codereview.chromium.org/399363002/diff/60001/extensions/renderer/api_test_base.cc#newcode50 extensions/renderer/api_test_base.cc:50: base::MessageLoop::current()->PostTask(FROM_HERE, run_loop_->QuitClosure()); do you mean to also pump the ...
6 years, 5 months ago (2014-07-18 15:09:14 UTC) #2
Sam McNally
https://codereview.chromium.org/399363002/diff/60001/extensions/renderer/api_test_base.cc File extensions/renderer/api_test_base.cc (right): https://codereview.chromium.org/399363002/diff/60001/extensions/renderer/api_test_base.cc#newcode50 extensions/renderer/api_test_base.cc:50: base::MessageLoop::current()->PostTask(FROM_HERE, run_loop_->QuitClosure()); On 2014/07/18 15:09:13, kalman wrote: > do ...
6 years, 5 months ago (2014-07-21 03:56:28 UTC) #3
raymes
https://codereview.chromium.org/399363002/diff/180001/extensions/renderer/api_test_base.h File extensions/renderer/api_test_base.h (right): https://codereview.chromium.org/399363002/diff/180001/extensions/renderer/api_test_base.h#newcode88 extensions/renderer/api_test_base.h:88: gin::Handle<TestServiceProvider> service_provider_; gin handles aren't safe to have on ...
6 years, 5 months ago (2014-07-24 08:17:39 UTC) #4
Sam McNally
https://codereview.chromium.org/399363002/diff/180001/extensions/renderer/api_test_base.h File extensions/renderer/api_test_base.h (right): https://codereview.chromium.org/399363002/diff/180001/extensions/renderer/api_test_base.h#newcode88 extensions/renderer/api_test_base.h:88: gin::Handle<TestServiceProvider> service_provider_; On 2014/07/24 08:17:38, raymes wrote: > gin ...
6 years, 5 months ago (2014-07-24 08:44:37 UTC) #5
not at google - send to devlin
looks fine but 2 questions https://codereview.chromium.org/399363002/diff/270001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/399363002/diff/270001/extensions/renderer/dispatcher.cc#newcode493 extensions/renderer/dispatcher.cc:493: std::make_pair(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS)); this mojo ...
6 years, 5 months ago (2014-07-25 00:17:58 UTC) #6
Sam McNally
https://codereview.chromium.org/399363002/diff/270001/extensions/renderer/dispatcher.cc File extensions/renderer/dispatcher.cc (right): https://codereview.chromium.org/399363002/diff/270001/extensions/renderer/dispatcher.cc#newcode493 extensions/renderer/dispatcher.cc:493: std::make_pair(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS)); On 2014/07/25 00:17:57, kalman wrote: > this ...
6 years, 5 months ago (2014-07-25 07:38:59 UTC) #7
not at google - send to devlin
lgtm https://codereview.chromium.org/399363002/diff/370001/extensions/renderer/dispatcher.h File extensions/renderer/dispatcher.h (right): https://codereview.chromium.org/399363002/diff/370001/extensions/renderer/dispatcher.h#newcode143 extensions/renderer/dispatcher.h:143: static void RegisterNativeHandlers(ModuleSystem* module_system, document this method and ...
6 years, 5 months ago (2014-07-25 15:59:07 UTC) #8
Sam McNally
+darin for the DEPS changes.
6 years, 5 months ago (2014-07-25 22:38:11 UTC) #9
darin (slow to review)
LGTM for DEPS change
6 years, 5 months ago (2014-07-25 22:53:32 UTC) #10
Sam McNally
The CQ bit was checked by sammc@chromium.org
6 years, 5 months ago (2014-07-25 23:00:07 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/399363002/370001
6 years, 5 months ago (2014-07-25 23:01:31 UTC) #12
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium ...
6 years, 5 months ago (2014-07-25 23:08:36 UTC) #13
Sam McNally
The CQ bit was unchecked by sammc@chromium.org
6 years, 5 months ago (2014-07-25 23:09:32 UTC) #14
Sam McNally
The CQ bit was checked by sammc@chromium.org
6 years, 5 months ago (2014-07-25 23:22:03 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/399363002/390001
6 years, 5 months ago (2014-07-25 23:23:02 UTC) #16
Sam McNally
The CQ bit was checked by sammc@chromium.org
6 years, 5 months ago (2014-07-26 01:06:25 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/399363002/410001
6 years, 5 months ago (2014-07-26 05:00:22 UTC) #18
Sam McNally
The CQ bit was checked by sammc@chromium.org
6 years, 5 months ago (2014-07-26 11:11:22 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/sammc@chromium.org/399363002/430001
6 years, 5 months ago (2014-07-26 11:13:57 UTC) #20
commit-bot: I haz the power
6 years, 5 months ago (2014-07-26 19:48:08 UTC) #21
Message was sent while issue was closed.
Change committed as 285792

Powered by Google App Engine
This is Rietveld 408576698