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

Issue 1130553002: Web component test framework (wcTest.BrowserTest) (Closed)

Created:
5 years, 7 months ago by michaelpg
Modified:
5 years, 6 months ago
Reviewers:
Jeremy Klein
CC:
chromium-reviews, stevenjb, James Hawkins, Oren Blasberg, Jeremy Klein, Kyle Horimoto, Dan Beam
Base URL:
https://chromium.googlesource.com/chromium/src.git@MochaAdapter
Target Ref:
refs/pending/heads/MochaAdapter
Project:
chromium
Visibility:
Public.

Description

Web component test framework (wcTest.BrowserTest) This is the 3rd of 3 CLs to enable support for testing web components in Chrome. This provides the wcTest.BrowserTest framework for writing async Polymer tests using Mocha. Based on first two patches: 1. http://crrev.com/1128543002 2. http://crrev.com/1124873002 A sample test is included (CrElementsBrowserTest), which currently only references one set of tests (for cr-checkbox) but is intended to cover all cr-elements in ui/webui/resources/cr_elements. Other tests which also extend wcTest.BrowserTest will be developed, such as a test suite for Settings elements. BUG=482770

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+184 lines, -2 lines) Patch
M chrome/browser/ui/webui/web_component_test_ui.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/chrome_tests.gypi View 2 chunks +3 lines, -0 lines 0 comments Download
A chrome/test/data/webui/cr_checkbox_tests.js View 1 chunk +70 lines, -0 lines 4 comments Download
A chrome/test/data/webui/cr_elements_browsertest.js View 1 chunk +33 lines, -0 lines 0 comments Download
A chrome/test/data/webui/web_component_test.js View 1 chunk +77 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
michaelpg
Episode III: Revenge of the Sith. https://codereview.chromium.org/1130553002/diff/1/chrome/test/data/webui/cr_checkbox_tests.js File chrome/test/data/webui/cr_checkbox_tests.js (right): https://codereview.chromium.org/1130553002/diff/1/chrome/test/data/webui/cr_checkbox_tests.js#newcode1 chrome/test/data/webui/cr_checkbox_tests.js:1: // Copyright 2015 ...
5 years, 7 months ago (2015-05-05 22:19:50 UTC) #1
michaelpg
5 years, 7 months ago (2015-05-05 22:20:33 UTC) #2
Jeremy Klein
5 years, 7 months ago (2015-05-06 18:03:36 UTC) #4
Cool stuff :-)

https://codereview.chromium.org/1130553002/diff/1/chrome/test/data/webui/cr_c...
File chrome/test/data/webui/cr_checkbox_tests.js (right):

https://codereview.chromium.org/1130553002/diff/1/chrome/test/data/webui/cr_c...
chrome/test/data/webui/cr_checkbox_tests.js:1: // Copyright 2015 The Chromium
Authors. All rights reserved.
On 2015/05/05 22:19:50, michaelpg wrote:
> It may make more sense to locate these tests alongside the source files, e.g.
in
> ui/webui/resources/cr_elements/cr_checkbox in this case.

+1 to keeping tests by their unit under test if possible.

https://codereview.chromium.org/1130553002/diff/1/chrome/test/data/webui/cr_c...
chrome/test/data/webui/cr_checkbox_tests.js:20: checkbox =
document.createElement('cr-checkbox');
Think it would be simple to use test-fixture for more complex dom structure? It
would let us do stuff like this:

https://github.com/PolymerElements/paper-checkbox/blob/master/test/basic.html...

But we'd need to be able to run the html rather than just js. Not worth a huge
effort, but would be convenient.

https://codereview.chromium.org/1130553002/diff/1/chrome/test/data/webui/cr_c...
chrome/test/data/webui/cr_checkbox_tests.js:54: checkbox.$.checkbox.tap();
note: iron-test-helpers has some useful bits we'll be able to use with 0.8,
particularly MockInteractions:

https://github.com/PolymerElements/iron-test-helpers

Powered by Google App Engine
This is Rietveld 408576698