| 
 | 
 | 
 Chromium Code Reviews
 Chromium Code Reviews Issue 
            2141313002:
    Settings Router Refactor: Implement new Route class w/ test  (Closed)
    
  
    Issue 
            2141313002:
    Settings Router Refactor: Implement new Route class w/ test  (Closed) 
  | Created: 4 years, 5 months ago by tommycli Modified: 4 years, 5 months ago CC: chromium-reviews, michaelpg+watch-md-settings_chromium.org, michaelpg+watch-md-ui_chromium.org, arv+watch_chromium.org, vitalyp+closure_chromium.org, dbeam+watch-settings_chromium.org, dbeam+watch-closure_chromium.org, stevenjb+watch-md-settings_chromium.org, jlklein+watch-closure_chromium.org Base URL: https://chromium.googlesource.com/chromium/src.git@master Target Ref: refs/pending/heads/master Project: chromium Visibility: Public. | DescriptionSettings Router Refactor: Implement new Route class w/ test
This is part 1 of Routing Refactor. Implements the new Route class
disconnected from settings-router. Connection will follow in further patches.
BUG=608115
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation
Committed: https://crrev.com/4de33e038c4fd0a8ad128e4b224382a6bcf489b0
Cr-Commit-Position: refs/heads/master@{#405349}
   Patch Set 1 #
      Total comments: 26
      
     Patch Set 2 : all changes except move route.* to root dir #Patch Set 3 : Move to root dir #
      Total comments: 1
      
     Patch Set 4 : make parent variable private #Patch Set 5 : merge #
 Messages
    Total messages: 30 (16 generated)
     
 Description was changed from ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from the BUG=608115 ========== to ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from the BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation ========== 
 Description was changed from ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from the BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation ========== to ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from settings-router. Connection will follow in further patches. BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation ========== 
 tommycli@chromium.org changed reviewers: + dbeam@chromium.org, michaelpg@chromium.org 
 dbeam/michaelpg: PTAL Based on design doc. Thanks 
 https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_page/route.html (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.html:1: <link rel="import" href="chrome://resources/html/cr.html"> the settings_page dir is getting big, and I never really got why the router fit with the other stuff since it isn't a page or part of a page. perhaps we should create a directory first for the router stuff and move settings_router.* there, and/or create this in that directory too https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_page/route.js (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:8: * @private optional CL-wide nit: our convention is to put @private after all other @-declarations https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:13: /** @type {string} */ closure doesn't infer this? https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:16: /** @type {settings.Route} */ {?settings.Route} https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:22: /** @type {string} */ same questions about types https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:56: * Return a new Route instance that's a child dialog of this route. Returns https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_page/settings_router.html (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/settings_router.html:3: <link rel="import" href="/settings_page/route.html"> do this later https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_resources.grd (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_resources.grd:656: flattenhtml="true" do you need this? https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_resources.grd:657: allowexternalscript="true" /> ditto https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... File chrome/test/data/webui/settings/router_tests.js (right): https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:15: test('new route tree structure', function() { these should be run separately, from a test that loads route.html, IMO https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:28: assertFalse(ADVANCED.isDescendantOf(PRIVACY))? https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:29: var SITE_SETTINGS = PRIVACY.createChild('/siteSettings'); we should test opt_subpageName. incidentally, siteSettings is a subpage; did you intentionally leave that out here? https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:40: assertEquals('privacy', CLEAR_BROWSING_DATA.section); may as well test isDescendantOf for dialogs too 
 Patchset #2 (id:20001) has been deleted 
 Patchset #2 (id:40001) has been deleted 
 Patchset #2 (id:60001) has been deleted 
 Patchset #2 (id:80001) has been deleted 
 Patchset #2 (id:100001) has been deleted 
 michaelpg: thanks. PS2 contains all the changes except the route.* move, since that breaks the inter-patchset deltas. PS3 just moves the file. Tommy https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_page/route.html (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.html:1: <link rel="import" href="chrome://resources/html/cr.html"> On 2016/07/13 05:53:39, michaelpg (slow) wrote: > the settings_page dir is getting big, and I never really got why the router fit > with the other stuff since it isn't a page or part of a page. > > perhaps we should create a directory first for the router stuff and move > settings_router.* there, and/or create this in that directory too Done. I moved it to just the root path settings/, since it's pretty global. settings_router will be removed after this refactor is done, so it didn't seem necessary to create a settings/routes/ directory. Just putting routes.js/html in root dir seemed reasonable. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_page/route.js (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:8: * @private On 2016/07/13 05:53:39, michaelpg (slow) wrote: > optional CL-wide nit: our convention is to put @private after all other > @-declarations Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:13: /** @type {string} */ On 2016/07/13 05:53:39, michaelpg (slow) wrote: > closure doesn't infer this? Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:16: /** @type {settings.Route} */ On 2016/07/13 05:53:39, michaelpg (slow) wrote: > {?settings.Route} Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:22: /** @type {string} */ On 2016/07/13 05:53:39, michaelpg (slow) wrote: > same questions about types Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/route.js:56: * Return a new Route instance that's a child dialog of this route. On 2016/07/13 05:53:39, michaelpg (slow) wrote: > Returns Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_page/settings_router.html (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_page/settings_router.html:3: <link rel="import" href="/settings_page/route.html"> On 2016/07/13 05:53:39, michaelpg (slow) wrote: > do this later Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... File chrome/browser/resources/settings/settings_resources.grd (right): https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_resources.grd:656: flattenhtml="true" On 2016/07/13 05:53:39, michaelpg (slow) wrote: > do you need this? Done. https://codereview.chromium.org/2141313002/diff/1/chrome/browser/resources/se... chrome/browser/resources/settings/settings_resources.grd:657: allowexternalscript="true" /> On 2016/07/13 05:53:39, michaelpg (slow) wrote: > ditto Done. https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... File chrome/test/data/webui/settings/router_tests.js (right): https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:15: test('new route tree structure', function() { On 2016/07/13 05:53:40, michaelpg (slow) wrote: > these should be run separately, from a test that loads route.html, IMO Done. https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:28: On 2016/07/13 05:53:39, michaelpg (slow) wrote: > assertFalse(ADVANCED.isDescendantOf(PRIVACY))? Done. https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:29: var SITE_SETTINGS = PRIVACY.createChild('/siteSettings'); On 2016/07/13 05:53:40, michaelpg (slow) wrote: > we should test opt_subpageName. incidentally, siteSettings is a subpage; did you > intentionally leave that out here? Done. No it was just an oversight. In fact, testing this caught a bug in the subpage array implementation. https://codereview.chromium.org/2141313002/diff/1/chrome/test/data/webui/sett... chrome/test/data/webui/settings/router_tests.js:40: assertEquals('privacy', CLEAR_BROWSING_DATA.section); On 2016/07/13 05:53:40, michaelpg (slow) wrote: > may as well test isDescendantOf for dialogs too Done. 
 lgtm 
 On 2016/07/13 17:59:21, michaelpg (slow) wrote: > lgtm thank you sir! 
 lgtm https://codereview.chromium.org/2141313002/diff/140001/chrome/browser/resourc... File chrome/browser/resources/settings/route.js (right): https://codereview.chromium.org/2141313002/diff/140001/chrome/browser/resourc... chrome/browser/resources/settings/route.js:16: this.parent = null; can this be private? 
 dbeam: thanks! i made it private 
 The CQ bit was checked by tommycli@chromium.org 
 The patchset sent to the CQ was uploaded after l-g-t-m from dbeam@chromium.org, michaelpg@chromium.org Link to the patchset: https://codereview.chromium.org/2141313002/#ps160001 (title: "make parent variable private") 
 CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 Your CL relies on deprecated CQ feature(s): * Specifying master names without "master." prefix is deprecated: tryserver.chromium.linux. For more details, see http://crbug.com/617627. 
 The CQ bit was unchecked by commit-bot@chromium.org 
 Try jobs failed on following builders: ios-device-gn on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device-gn/bui...) ios-simulator on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator/bui...) ios-simulator-gn on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-simulator-gn/...) mac_chromium_compile_dbg_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...) 
 The CQ bit was checked by tommycli@chromium.org 
 The patchset sent to the CQ was uploaded after l-g-t-m from dbeam@chromium.org, michaelpg@chromium.org Link to the patchset: https://codereview.chromium.org/2141313002/#ps180001 (title: "merge") 
 CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or... 
 
            
              
                Message was sent while issue was closed.
              
            
             Description was changed from ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from settings-router. Connection will follow in further patches. BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation ========== to ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from settings-router. Connection will follow in further patches. BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             Committed patchset #5 (id:180001) 
 
            
              
                Message was sent while issue was closed.
              
            
             CQ bit was unchecked. 
 
            
              
                Message was sent while issue was closed.
              
            
             Description was changed from ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from settings-router. Connection will follow in further patches. BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation ========== to ========== Settings Router Refactor: Implement new Route class w/ test This is part 1 of Routing Refactor. Implements the new Route class disconnected from settings-router. Connection will follow in further patches. BUG=608115 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:closure_compilation Committed: https://crrev.com/4de33e038c4fd0a8ad128e4b224382a6bcf489b0 Cr-Commit-Position: refs/heads/master@{#405349} ========== 
 
            
              
                Message was sent while issue was closed.
              
            
             Patchset 5 (id:??) landed as https://crrev.com/4de33e038c4fd0a8ad128e4b224382a6bcf489b0 Cr-Commit-Position: refs/heads/master@{#405349} 
 
            
              
                Message was sent while issue was closed.
              
            
             Patchset #6 (id:200001) has been deleted | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
