Bug 1379292 - Made changes to test to use new harness filtering r=chutten
☠☠ backed out by 85332a69ae0c ☠ ☠
authorJohn Dorlus <jsdorlus@gmail.com>
Mon, 10 Jul 2017 16:17:19 -0400
changeset 368272 064f2ad7ca3bcd37df0ca60dd870a722ca96c756
parent 368271 e123b6e47340e0fba6d6d8c4d5f64b665b5e72a0
child 368273 051284a3564e0a798fea06a7dde26300ac2288a6
push id46263
push userryanvm@gmail.com
push dateTue, 11 Jul 2017 17:17:08 +0000
treeherderautoland@064f2ad7ca3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1379292
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1379292 - Made changes to test to use new harness filtering r=chutten Self explanatory. Also added some waits for test hardiness. Used lambdas so that the caller can specify criteria for filtering. MozReview-Commit-ID: BBQj0TO6kyq
toolkit/components/telemetry/tests/marionette/tests/client/test_main_tab_scalars.py
--- a/toolkit/components/telemetry/tests/marionette/tests/client/test_main_tab_scalars.py
+++ b/toolkit/components/telemetry/tests/marionette/tests/client/test_main_tab_scalars.py
@@ -1,27 +1,38 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+from marionette_driver.wait import Wait
+
 from telemetry_harness.testcase import TelemetryTestCase
 
 
 class TestMainTabScalars(TelemetryTestCase):
 
     def test_main_tab_scalars(self):
+        wait = Wait(self.marionette, 10)
+
         with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
             tab1 = self.browser.tabbar.selected_tab
             tab2 = self.browser.tabbar.open_tab()
+            wait.until(lambda m: len(self.browser.tabbar.tabs) == 2)
             self.browser.tabbar.switch_to(tab2)
             tab3 = self.browser.tabbar.open_tab()
+            wait.until(lambda m: len(self.browser.tabbar.tabs) == 3)
             self.browser.tabbar.switch_to(tab3)
             self.browser.tabbar.close_tab(tab3, force=True)
+            wait.until(lambda m: len(self.browser.tabbar.tabs) == 2)
             self.browser.tabbar.close_tab(tab2, force=True)
+            wait.until(lambda m: len(self.browser.tabbar.tabs) == 1)
             self.browser.tabbar.switch_to(tab1)
         self.restart_browser()
-        ping = self.wait_for_ping()
+        ping = self.wait_for_ping(lambda p: p['type'] == 'main'
+                                            and p['payload']['info']['reason'] == 'shutdown')
         assert ping['type'] == 'main'
         assert ping['clientId'] == self.client_id
         scalars = ping['payload']['processes']['parent']['scalars']
         assert scalars['browser.engagement.max_concurrent_tab_count'] == 3
         assert scalars['browser.engagement.tab_open_event_count'] == 2
         assert scalars['browser.engagement.max_concurrent_window_count'] == 1
+
+