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

Issue 2217493002: Revert of MD Settings: Adding some unit tests for <settings-main>. (Closed)

Created:
4 years, 4 months ago by Peter Beverloo
Modified:
4 years, 4 months ago
Reviewers:
michaelpg, dpapad
CC:
arv+watch_chromium.org, chromium-reviews, dbeam+watch-settings_chromium.org, Dan Beam, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, stevenjb+watch-md-settings_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@search_no_results
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revert of MD Settings: Adding some unit tests for <settings-main>. (patchset #4 id:360001 of https://codereview.chromium.org/2185493003/ ) Reason for revert: Causing various debug bots to fail browser_tests https://build.chromium.org/p/chromium.linux/builders/Linux%20Tests%20%28dbg%29%281%29%2832%29/builds/31788/steps/browser_tests%20on%20Ubuntu-12.04/logs/CrSettingsMainPageTest.All https://build.chromium.org/p/chromium.mac/builders/Mac10.9%20Tests%20%28dbg%29/builds/28095/steps/browser_tests%20on%20Mac-10.9/logs/CrSettingsMainPageTest.All A series of JavaScript errors are visible that preferences were not found for various elements, all in pref_control_behavior.js:38 Original issue's description: > MD Settings: Adding some unit tests for <settings-main>. > > Specifically testing the "no results" message is shown/hidden as expected. > - Splitting SearchManager to an interface and an implementation. > - Using a TestSearchManager class (implements SearchManager) for testing > <settings-main>. > > BUG=630383 > CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation > > Committed: https://crrev.com/bb8fba2c2dbc0b02555f11877f4929786eab456c > Cr-Commit-Position: refs/heads/master@{#409615} TBR=michaelpg@chromium.org,dpapad@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=630383 Committed: https://crrev.com/563a4d1a4a02714746f0782cafea9c5ad247c4ae Cr-Commit-Position: refs/heads/master@{#409790}

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -201 lines) Patch
M chrome/browser/resources/settings/search_settings.js View 8 chunks +22 lines, -41 lines 0 comments Download
M chrome/browser/resources/settings/settings_main/settings_main.html View 2 chunks +3 lines, -4 lines 0 comments Download
M chrome/browser/resources/settings/settings_main/settings_main.js View 2 chunks +20 lines, -25 lines 0 comments Download
M chrome/browser/resources/settings/settings_page/main_page_behavior.js View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/test/data/webui/settings/cr_settings_browsertest.js View 1 chunk +0 lines, -24 lines 0 comments Download
D chrome/test/data/webui/settings/settings_main_test.js View 1 chunk +0 lines, -103 lines 1 comment Download

Messages

Total messages: 8 (3 generated)
Peter Beverloo
Created Revert of MD Settings: Adding some unit tests for <settings-main>.
4 years, 4 months ago (2016-08-04 15:27:04 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2217493002/1
4 years, 4 months ago (2016-08-04 15:27:43 UTC) #3
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 4 months ago (2016-08-04 15:28:38 UTC) #5
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/563a4d1a4a02714746f0782cafea9c5ad247c4ae Cr-Commit-Position: refs/heads/master@{#409790}
4 years, 4 months ago (2016-08-04 15:31:02 UTC) #7
michaelpg
4 years, 4 months ago (2016-08-04 18:10:18 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/2217493002/diff/1/chrome/test/data/webui/sett...
File chrome/test/data/webui/settings/settings_main_test.js (left):

https://codereview.chromium.org/2217493002/diff/1/chrome/test/data/webui/sett...
chrome/test/data/webui/settings/settings_main_test.js:61: settingsMain.prefs =
settingsPrefs.prefs;
I think we need to create the <settings-prefs> after <settings-main>; if we
create it too early, the browser could respond with the prefs, causing
CrSettingsPrefs.initialized to resolve... so when we create <settings-main> all
the pref controls think the prefs should be available before we even set the
prefs property.

this is likely since setup() is called before each test, and the tests are
async.

you could test this by returning CrSettingsPrefs.initialized in suiteSetup(),
which would force the test to wait until the prefs come back from the browser...
at that point creating settings-main should fail 100% of the time.

You may then have to call settingsPrefs.resetForTesting() in the teardown, as
otherwise creating the new settings-main would fail.

Powered by Google App Engine
This is Rietveld 408576698