Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Issue 85223002: [Gin] Add a basic unit testing framework (Closed)

Created:
7 years ago by abarth-chromium
Modified:
7 years ago
CC:
chromium-reviews, Aaron Boodman, darin (slow to review), viettrungluu+watch_chromium.org, ben+mojo_chromium.org
Visibility:
Public.

Description

[Gin] Add a basic unit testing framework Previously, we were using JavaScript bindings to gtest to unit test JavaScript code in Gin and Mojo. The gtest bindings were very basic and not very idiomatic. This CL introduces a simple AMD module call "expect" to help us write more idiomatic unit tests. The API for "expect" is based on the popular Jasmine unit testing framework for node.js. I investigated just importing one of Node's many unit testing frameworks, but they all try to do too much (e.g., drive the entire test harness via Node's file system interface). The "expect" modules doesn't try to drive the testing process. We just let gtest handle that. Instead, "expect" just provides a simple language in which to write test assertions. We'll likely evolve our testing strategy over time, but hopefully this CL is an improvement over the primitive gtest bindings. [email protected] [email protected] BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=237145

Patch Set 1 #

Patch Set 2 : Remove extra function #

Total comments: 1

Patch Set 3 : Make webview_licenses.py happy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+424 lines, -147 lines) Patch
M android_webview/tools/webview_licenses.py View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M gin/converter.h View 1 chunk +2 lines, -0 lines 0 comments Download
M gin/converter.cc View 1 chunk +8 lines, -0 lines 0 comments Download
M gin/runner.h View 1 chunk +1 line, -1 line 0 comments Download
M gin/runner.cc View 1 chunk +3 lines, -2 lines 0 comments Download
M gin/runner_unittest.cc View 1 chunk +1 line, -1 line 0 comments Download
M gin/shell/gin_main.cc View 3 chunks +9 lines, -4 lines 0 comments Download
A gin/test/expect.js View 1 chunk +289 lines, -0 lines 0 comments Download
M gin/test/file_runner.cc View 2 chunks +4 lines, -5 lines 0 comments Download
M gin/test/gtest.cc View 2 chunks +12 lines, -0 lines 0 comments Download
M gin/try_catch.h View 1 1 chunk +1 line, -1 line 0 comments Download
M gin/try_catch.cc View 2 chunks +23 lines, -9 lines 0 comments Download
M mojo/apps/js/main.cc View 1 chunk +2 lines, -1 line 0 comments Download
M mojo/apps/js/mojo_runner_delegate.cc View 1 chunk +1 line, -1 line 0 comments Download
M mojo/public/bindings/js/codec_unittests.js View 5 chunks +32 lines, -67 lines 0 comments Download
M mojo/public/bindings/js/core_unittests.js View 3 chunks +10 lines, -21 lines 0 comments Download
M mojo/public/bindings/sample/sample_test.js View 3 chunks +24 lines, -34 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
abarth-chromium
7 years ago (2013-11-25 06:20:40 UTC) #1
jochen (gone - plz use gerrit)
lgtm can you add a BUG= line? Can you make sure the reference to the ...
7 years ago (2013-11-25 08:19:24 UTC) #2
abarth-chromium
On 2013/11/25 08:19:24, jochen wrote: > can you add a BUG= line? What bug should ...
7 years ago (2013-11-25 16:29:13 UTC) #3
jochen (gone - plz use gerrit)
On 2013/11/25 16:29:13, abarth wrote: > On 2013/11/25 08:19:24, jochen wrote: > > can you ...
7 years ago (2013-11-25 16:32:01 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/85223002/40001
7 years ago (2013-11-25 17:00:06 UTC) #5
commit-bot: I haz the power
Retried try job too often on android_dbg for step(s) slave_steps http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=android_dbg&number=126158
7 years ago (2013-11-25 18:31:40 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/85223002/40001
7 years ago (2013-11-25 18:34:05 UTC) #7
abarth-chromium
@joth: Can you take a look at webview_licenses.py ? Thanks!
7 years ago (2013-11-25 18:43:14 UTC) #8
abarth-chromium
On 2013/11/25 18:43:14, abarth wrote: > @joth: Can you take a look at webview_licenses.py ? ...
7 years ago (2013-11-25 20:35:25 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/[email protected]/85223002/70001
7 years ago (2013-11-25 20:37:04 UTC) #10
abarth-chromium
Committed patchset #3 manually as r237145 (presubmit successful).
7 years ago (2013-11-25 21:26:38 UTC) #11
joth
lgtm
7 years ago (2013-11-25 22:20:27 UTC) #12
abarth-chromium
7 years ago (2013-11-25 22:31:26 UTC) #13
Message was sent while issue was closed.
On 2013/11/25 22:20:27, joth wrote:
> lgtm

Thanks!

Powered by Google App Engine
This is Rietveld 408576698