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

Side by Side Diff: chrome/test/chromedriver/test/run_py_tests.py

Issue 1022543002: [chromedriver] Implement DELETE NetworkConditions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2013 The Chromium Authors. All rights reserved. 2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """End to end tests for ChromeDriver.""" 6 """End to end tests for ChromeDriver."""
7 7
8 import base64 8 import base64
9 import json 9 import json
10 import math 10 import math
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 latency = 5 804 latency = 5
805 throughput = 2048 * 1024 805 throughput = 2048 * 1024
806 self._driver.SetNetworkConditions(latency, throughput, throughput) 806 self._driver.SetNetworkConditions(latency, throughput, throughput)
807 807
808 network = self._driver.GetNetworkConditions() 808 network = self._driver.GetNetworkConditions()
809 self.assertEquals(latency, network['latency']); 809 self.assertEquals(latency, network['latency']);
810 self.assertEquals(throughput, network['download_throughput']); 810 self.assertEquals(throughput, network['download_throughput']);
811 self.assertEquals(throughput, network['upload_throughput']); 811 self.assertEquals(throughput, network['upload_throughput']);
812 self.assertEquals(False, network['offline']); 812 self.assertEquals(False, network['offline']);
813 813
814 self._driver.DeleteNetworkConditions()
815
816 network = self._driver.GetNetworkConditions()
817 self.assertEquals(0, network['latency']);
818 self.assertLess(network['download_throughput'], 0);
819 self.assertLess(network['upload_throughput'], 0);
820 self.assertEquals(False, network['offline']);
samuong 2015/03/18 17:58:43 should this return a zeroed-out dictionary, or a "
srawlins 2015/03/18 18:24:25 Yeah I can refactor this to delete the overriddenN
samuong 2015/03/18 18:32:23 I'm OK with either, but I think that if a user per
821
814 def testEmulateNetworkConditionsName(self): 822 def testEmulateNetworkConditionsName(self):
815 # DSL: 2Mbps throughput, 5ms RTT 823 # DSL: 2Mbps throughput, 5ms RTT
816 #latency = 5 824 #latency = 5
817 #throughput = 2048 * 1024 825 #throughput = 2048 * 1024
818 self._driver.SetNetworkConditionsName('DSL') 826 self._driver.SetNetworkConditionsName('DSL')
819 827
820 network = self._driver.GetNetworkConditions() 828 network = self._driver.GetNetworkConditions()
821 self.assertEquals(5, network['latency']); 829 self.assertEquals(5, network['latency']);
822 self.assertEquals(2048*1024, network['download_throughput']); 830 self.assertEquals(2048*1024, network['download_throughput']);
823 self.assertEquals(2048*1024, network['upload_throughput']); 831 self.assertEquals(2048*1024, network['upload_throughput']);
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
1538 1546
1539 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule( 1547 all_tests_suite = unittest.defaultTestLoader.loadTestsFromModule(
1540 sys.modules[__name__]) 1548 sys.modules[__name__])
1541 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter) 1549 tests = unittest_util.FilterTestSuite(all_tests_suite, options.filter)
1542 ChromeDriverTest.GlobalSetUp() 1550 ChromeDriverTest.GlobalSetUp()
1543 MobileEmulationCapabilityTest.GlobalSetUp() 1551 MobileEmulationCapabilityTest.GlobalSetUp()
1544 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests) 1552 result = unittest.TextTestRunner(stream=sys.stdout, verbosity=2).run(tests)
1545 ChromeDriverTest.GlobalTearDown() 1553 ChromeDriverTest.GlobalTearDown()
1546 MobileEmulationCapabilityTest.GlobalTearDown() 1554 MobileEmulationCapabilityTest.GlobalTearDown()
1547 sys.exit(len(result.failures) + len(result.errors)) 1555 sys.exit(len(result.failures) + len(result.errors))
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/server/http_handler.cc ('k') | chrome/test/chromedriver/window_commands.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698