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

Unified Diff: tools/telemetry/telemetry/tab_list_backend.py

Issue 12260020: [Telemetry] Fix tab list updating with connected tabs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: New unit tests. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/telemetry/telemetry/browser_unittest.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/telemetry/telemetry/tab_list_backend.py
diff --git a/tools/telemetry/telemetry/tab_list_backend.py b/tools/telemetry/telemetry/tab_list_backend.py
index a6ed8f81da0d7e7feb02641fdb0206dd8abe43da..ef2f13ad252c470c01f8447df325465ea2b0babd 100644
--- a/tools/telemetry/telemetry/tab_list_backend.py
+++ b/tools/telemetry/telemetry/tab_list_backend.py
@@ -61,6 +61,9 @@ class TabListBackend(object):
assert response == 'Target is closing'
util.WaitFor(lambda: not self._FindTabInfo(debugger_url), timeout=5)
+
+ if debugger_url in self._tab_dict:
+ del self._tab_dict[debugger_url]
self._UpdateTabList()
def ActivateTab(self, debugger_url, timeout=None):
@@ -133,9 +136,11 @@ class TabListBackend(object):
if 'webSocketDebuggerUrl' not in tab_info:
return None
return tab_info['webSocketDebuggerUrl']
- newtab_list = map(GetDebuggerUrl, self._ListTabs())
- self._tab_list = [t for t in self._tab_list if t in newtab_list]
- self._tab_list += [t for t in newtab_list if t not in self._tab_list]
+ new_tab_list = map(GetDebuggerUrl, self._ListTabs())
+ self._tab_list = [t for t in self._tab_list
+ if t in self._tab_dict or t in new_tab_list]
+ self._tab_list += [t for t in new_tab_list
+ if t is not None and t not in self._tab_list]
def _FindTabInfo(self, debugger_url):
for tab_info in self._ListTabs():
« no previous file with comments | « tools/telemetry/telemetry/browser_unittest.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698