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

Issue 6992019: Allow overriding WebUIFactory when test flag is set. (Closed)

Created:
9 years, 7 months ago by Sheridan Rawlins
Modified:
9 years, 6 months ago
CC:
chromium-reviews, Paweł Hajdan Jr., David Tseng, Satish
Visibility:
Public.

Description

Allow overriding WebUIFactory when test flag is set. In order to allow mocking function calls as soon as possible (before any javascript is run), we create a factory capable of registering overrides per-host. BUG=82437 R=estade@chromium.org TEST=browser_tests --gtest_filter=TestChromeWebUIFactoryTest.* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86764

Patch Set 1 #

Patch Set 2 : Removed unused testing:: classes. #

Patch Set 3 : comment namespace end. #

Total comments: 27

Patch Set 4 : some nits from review. #

Patch Set 5 : remove another use of || around non-variable. #

Patch Set 6 : Commented decision to switch on test-type in traits class. #

Patch Set 7 : Adjusted comment to describe decision to keep registry add/remove in the #

Total comments: 1

Patch Set 8 : Fix nit from review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+210 lines, -3 lines) Patch
M chrome/browser/ui/webui/chrome_web_ui_factory.h View 1 2 3 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/chrome_web_ui_factory.cc View 1 2 3 4 5 3 chunks +17 lines, -1 line 0 comments Download
A chrome/browser/ui/webui/test_chrome_web_ui_factory.h View 1 2 3 1 chunk +69 lines, -0 lines 0 comments Download
A chrome/browser/ui/webui/test_chrome_web_ui_factory.cc View 1 2 3 4 5 6 7 1 chunk +53 lines, -0 lines 0 comments Download
A chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc View 1 2 3 4 5 6 7 1 chunk +63 lines, -0 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Sheridan Rawlins
Evan, You mentioned refactoring the ChomeWebUIFactory recently. The hope of this new class is to ...
9 years, 7 months ago (2011-05-24 05:57:05 UTC) #1
Evan Stade
just nits http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/chrome_web_ui_factory.cc File chrome/browser/ui/webui/chrome_web_ui_factory.cc (right): http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/chrome_web_ui_factory.cc#newcode224 chrome/browser/ui/webui/chrome_web_ui_factory.cc:224: struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { explicitly ...
9 years, 7 months ago (2011-05-24 17:25:59 UTC) #2
Lei Zhang (Do not use)
some nits below: (whoops, just realized I was using the wrong acct) http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/chrome_web_ui_factory.cc File chrome/browser/ui/webui/chrome_web_ui_factory.cc ...
9 years, 7 months ago (2011-05-24 18:00:06 UTC) #3
Sheridan Rawlins
I addressed some nits from review and replied to others. Please consider the defense, and ...
9 years, 7 months ago (2011-05-24 20:17:21 UTC) #4
Sheridan Rawlins
Added comment. http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/chrome_web_ui_factory.cc File chrome/browser/ui/webui/chrome_web_ui_factory.cc (right): http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/chrome_web_ui_factory.cc#newcode224 chrome/browser/ui/webui/chrome_web_ui_factory.cc:224: struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { As ...
9 years, 7 months ago (2011-05-25 18:29:42 UTC) #5
Evan Stade
http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc File chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc (right): http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc#newcode46 chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc:46: GURL(kChromeTestChromeWebUIFactory).host()); no, I meant why is everything within SetUp ...
9 years, 7 months ago (2011-05-25 18:49:03 UTC) #6
Sheridan Rawlins
http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc File chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc (right): http://codereview.chromium.org/6992019/diff/5001/chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc#newcode46 chrome/browser/ui/webui/test_chrome_web_ui_factory_browsertest.cc:46: GURL(kChromeTestChromeWebUIFactory).host()); If I move the add/remove to the method, ...
9 years, 7 months ago (2011-05-25 21:02:55 UTC) #7
Evan Stade
lgtm -- Evan Stade On Wed, May 25, 2011 at 2:02 PM, <scr@chromium.org> wrote: > ...
9 years, 7 months ago (2011-05-25 21:14:13 UTC) #8
Lei Zhang
LGTM http://codereview.chromium.org/6992019/diff/19/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc File chrome/browser/ui/webui/test_chrome_web_ui_factory.cc (right): http://codereview.chromium.org/6992019/diff/19/chrome/browser/ui/webui/test_chrome_web_ui_factory.cc#newcode7 chrome/browser/ui/webui/test_chrome_web_ui_factory.cc:7: #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" nit: You don't need to include ...
9 years, 7 months ago (2011-05-25 21:21:18 UTC) #9
commit-bot: I haz the power
9 years, 7 months ago (2011-05-26 01:43:03 UTC) #10
Change committed as 86764

Powered by Google App Engine
This is Rietveld 408576698