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

Issue 150213: Add a ExtensionBrowserTest base class (Closed)

Created:
11 years, 5 months ago by Aaron Boodman
Modified:
9 years, 6 months ago
Reviewers:
Matt Perry
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Add an ExtensionBrowserTest base class that allows in-process browser tests of extensions using ExtensionsService directly, rather than TestExtensionLoaded. Use it to re-enable some old browser tests that had been disabled.

Patch Set 1 #

Patch Set 2 : Remove no longer needed TestExtensionLoader #

Patch Set 3 : comment sprucing #

Total comments: 10

Patch Set 4 : added timeouts fixed other tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+359 lines, -435 lines) Patch
A chrome/browser/extensions/extension_browsertest.h View 1 chunk +41 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_browsertest.cc View 1 2 3 1 chunk +95 lines, -152 lines 0 comments Download
A chrome/browser/extensions/extension_browsertests_misc.cc View 1 chunk +106 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_host.cc View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_shelf_model_unittest.cc View 4 chunks +15 lines, -34 lines 0 comments Download
M chrome/browser/extensions/extension_startup_unittest.cc View 1 2 3 5 chunks +9 lines, -19 lines 0 comments Download
M chrome/browser/extensions/extensions_service.h View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/extensions/test_extension_loader.h View 1 chunk +0 lines, -40 lines 0 comments Download
M chrome/browser/extensions/test_extension_loader.cc View 1 chunk +0 lines, -82 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host.cc View 1 2 3 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/renderer_host/render_view_host_manager_browsertest.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ssl/ssl_browser_tests.cc View 11 chunks +22 lines, -17 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.h View 1 2 3 1 chunk +0 lines, -2 lines 0 comments Download
M chrome/browser/tab_contents/tab_contents.cc View 1 2 3 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/views/extensions/extension_shelf.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/views/find_bar_win_browsertest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/views/frame/browser_view.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/chrome.gyp View 2 3 3 chunks +2 lines, -4 lines 0 comments Download
M chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip1.html View 1 chunk +10 lines, -35 lines 0 comments Download
M chrome/test/data/extensions/good/Extensions/behllobkkfkfnphdnhnkndlbkcpglgmj/1.0.0.0/toolstrip2.html View 1 chunk +0 lines, -21 lines 0 comments Download
M chrome/test/in_process_browser_test.h View 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/test/in_process_browser_test.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/ui_test_utils.h View 1 2 3 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/test/ui_test_utils.cc View 1 2 3 3 chunks +14 lines, -12 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Aaron Boodman
Add an ExtensionBrowserTest base class that allows in-process browser tests of extensions using ExtensionsService directly, ...
11 years, 5 months ago (2009-07-02 08:12:49 UTC) #1
Matt Perry
Mostly looks good. Just a few questions. http://codereview.chromium.org/150213/diff/37/38 File chrome/browser/extensions/extension_browsertest.cc (right): http://codereview.chromium.org/150213/diff/37/38#newcode41 Line 41: // ...
11 years, 5 months ago (2009-07-02 19:29:24 UTC) #2
Aaron Boodman
http://codereview.chromium.org/150213/diff/37/38 File chrome/browser/extensions/extension_browsertest.cc (right): http://codereview.chromium.org/150213/diff/37/38#newcode53 Line 53: void LoadExtension(const FilePath& path) { On 2009/07/02 19:29:24, ...
11 years, 5 months ago (2009-07-02 19:39:54 UTC) #3
Matt Perry
11 years, 5 months ago (2009-07-02 19:46:32 UTC) #4
LGTM, though I still suggest a timeout (could be a long one, on the order of
minutes)

http://codereview.chromium.org/150213/diff/37/38
File chrome/browser/extensions/extension_browsertest.cc (right):

http://codereview.chromium.org/150213/diff/37/38#newcode53
Line 53: void LoadExtension(const FilePath& path) {
On 2009/07/02 19:39:54, Aaron Boodman wrote:
> On 2009/07/02 19:29:24, Matt Perry wrote:
> > This mechanism is pretty much what TestExtensionLoader did.  Is there
> something
> > that makes this way more reliable?
> 
> Actually, no. I thought that TestExtensionLoaded did something different. I
must
> have been remembering some earlier version of it. The only thing that's
> different about this code is that it does not call Init().
> 
> For some reason I was thinking the problem with these tests was memory leaks,
> related to some weird way that we were loading extensions with
> TestExtensionLoader. Now that I look at the actual bugs, I see we disabled
them
> because they hung on linux. I wonder if this is fixed now that unpacking works
> on linux? Was there some other issue with these tests?

Actually, I thought it was memory issues as well.  I'm not sure.

I like your refactoring though.  Things are cleaner this way.  Let's run it
through the trybots and check it in, just watch for problems.

http://codereview.chromium.org/150213/diff/37/38#newcode58
Line 58: ui_test_utils::RunMessageLoop();
On 2009/07/02 19:39:54, Aaron Boodman wrote:
> On 2009/07/02 19:29:24, Matt Perry wrote:
> > no delayed QuitTask?  if the load fails, we'll hang here.
> 
> I think that the test runner will kill us if that happens, so it does not seem
> like a big deal. I guess I could put a timeout in, but I didn't see the
> advantage.

Small advantage: if this test fails, it will timeout and move onto other tests. 
without a timeout, the tests stop here and there's no further coverage.

Powered by Google App Engine
This is Rietveld 408576698