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

Issue 2111010: fix chrome.tabs.onUpdated bugs, add browsertest (Closed)

Created:
10 years, 7 months ago by rafaelw
Modified:
9 years, 7 months ago
Reviewers:
Matt Perry
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, Paweł Hajdan Jr., pam+watch_chromium.org, ben+cc_chromium.org
Base URL:
http://src.chromium.org/git/chromium.git
Visibility:
Public.

Description

fix chrome.tabs.onUpdated bugs, add browsertest. This CL addresses a few issues related to the behavior of the onUpdated event. Issue 1: The page re-entering the load state and the completing was causing multiple 'complete' status events to be fired. We now only report the first 'complete' after the didNavigate message is fired (iframe navigation, for example). Issue 2: We were initializing the URL when the TabEntry was created, and this caused us to fail to send the url with the first navigation because we thought it wasn't changing. BUG=27208, 37149 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=47717

Patch Set 1 #

Total comments: 8

Patch Set 2 : cr comments #

Total comments: 6

Patch Set 3 : more cr changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+195 lines, -83 lines) Patch
M chrome/browser/extensions/extension_browser_event_router.h View 1 2 2 chunks +5 lines, -14 lines 0 comments Download
M chrome/browser/extensions/extension_browser_event_router.cc View 1 2 3 chunks +17 lines, -39 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_apitest.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.h View 1 chunk +1 line, -9 lines 0 comments Download
M chrome/browser/extensions/extension_tabs_module.cc View 2 chunks +4 lines, -21 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/browserThenRendererInitiated/a.html View 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/browserThenRendererInitiated/b.html View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/iframeNavigated/a.html View 1 chunk +3 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/iframeNavigated/iframe1.html View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/iframeNavigated/iframe2.html View 1 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/iframeNavigated/iframe3.html View 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/internalAnchorNavigated/a.html View 1 chunk +14 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/manifest.json View 1 chunk +7 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/tabs/on_updated/test.html View 1 1 chunk +112 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
rafaelw
10 years, 7 months ago (2010-05-18 23:14:45 UTC) #1
Matt Perry
Mostly LG. Some comments. http://codereview.chromium.org/2111010/diff/1/3 File chrome/browser/extensions/extension_browser_event_router.h (right): http://codereview.chromium.org/2111010/diff/1/3#newcode134 chrome/browser/extensions/extension_browser_event_router.h:134: // NAV_ENTRY_COMMITTED, and is always ...
10 years, 7 months ago (2010-05-18 23:36:32 UTC) #2
rafaelw
http://codereview.chromium.org/2111010/diff/1/3 File chrome/browser/extensions/extension_browser_event_router.h (right): http://codereview.chromium.org/2111010/diff/1/3#newcode134 chrome/browser/extensions/extension_browser_event_router.h:134: // NAV_ENTRY_COMMITTED, and is always set to true on ...
10 years, 7 months ago (2010-05-18 23:57:04 UTC) #3
Matt Perry
LGTM with comments addressed. http://codereview.chromium.org/2111010/diff/7001/8001 File chrome/browser/extensions/extension_browser_event_router.cc (right): http://codereview.chromium.org/2111010/diff/7001/8001#newcode32 chrome/browser/extensions/extension_browser_event_router.cc:32: // We only want to ...
10 years, 7 months ago (2010-05-19 00:03:21 UTC) #4
rafaelw
10 years, 7 months ago (2010-05-19 00:21:50 UTC) #5
http://codereview.chromium.org/2111010/diff/7001/8001
File chrome/browser/extensions/extension_browser_event_router.cc (right):

http://codereview.chromium.org/2111010/diff/7001/8001#newcode32
chrome/browser/extensions/extension_browser_event_router.cc:32: // We only want
to respond to the first change from loading to !loading.
Further clarified and member renamed.

On 2010/05/19 00:03:22, Matt Perry wrote:
> This comment is slightly misleading given the behavior. We respond to
subsequent
> changes from loading -> !loading if the previous event was "loading". Right?

http://codereview.chromium.org/2111010/diff/7001/8009
File
chrome/test/data/extensions/api_test/tabs/on_updated/iframeNavigated/iframe1.html
(right):

http://codereview.chromium.org/2111010/diff/7001/8009#newcode4
chrome/test/data/extensions/api_test/tabs/on_updated/iframeNavigated/iframe1.html:4:
// Navigate during the onload that 'complete' status won't fire.
On 2010/05/19 00:03:22, Matt Perry wrote:
> nit: "so that"

Done.

http://codereview.chromium.org/2111010/diff/7001/8014
File chrome/test/data/extensions/api_test/tabs/on_updated/test.html (right):

http://codereview.chromium.org/2111010/diff/7001/8014#newcode86
chrome/test/data/extensions/api_test/tabs/on_updated/test.html:86: //
-iframe2.html does a setTimeout to navigate itself to iframe3.html. This
Ok. I'll be careful....

On 2010/05/19 00:03:22, Matt Perry wrote:
> This seems like it might be flaky, if the timeout happens to run before the
> 'complete' event is fired? Maybe not. Just an FYI to watch for it.

Powered by Google App Engine
This is Rietveld 408576698