Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
first runnable tv v2.5 mcts
Browse files Browse the repository at this point in the history
  • Loading branch information
Walter Chen authored and Walter Chen committed Mar 9, 2016
1 parent 6f4db31 commit 206c7b8
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 14 deletions.
20 changes: 20 additions & 0 deletions mcts/utils/device/devicehelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,32 @@
from mcts.utils.handlers.adb_b2g import ADBB2G
from marionette import Marionette


class NoADB():
def reboot(self):
pass
def wait_for_net(self):
pass
def shell_output(self):
pass
def forward(self, *args):
pass
def get_process_list(self):
return [[1447, '/sbin/adbd', 'root']]
def restart(self):
pass
def root(self):
pass
def devices(self, timeout=None):
pass

class DeviceHelper(object):
device = None
marionette = None

@staticmethod
def getDevice(DeviceManager=ADBB2G, **kwargs):
DeviceHelper.device = NoADB()
if not DeviceHelper.device:
DeviceHelper.device = DeviceManager(**kwargs)

Expand Down
8 changes: 4 additions & 4 deletions mcts/webapi_tests/certapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class CloseError(Exception):
pass


def install(marionette=None, version='1.3'):
def install(marionette=None, version='2.5'):
"""Installs the app on the attached device. Raises if app is
already installed, but a guard can be added using ``is_installed``.
Expand Down Expand Up @@ -72,11 +72,11 @@ def launch(marionette):

# If the app is already launched this doesn't launch a new app, but
# returns a reference to existing app.
app = marionette.execute_async_script(
"GaiaApps.launchWithName('%s')" % name, script_timeout=timeout)
app = marionette.execute_async_script("MCTS.test();")
active_app = marionette.execute_script("return MCTS.focus();")
marionette.switch_to_frame(active_app)
if app is None:
raise LaunchError("Unable to launch app: %s" % name)
activate(marionette, app=app)
return app


Expand Down
1 change: 0 additions & 1 deletion mcts/webapi_tests/presentation/test_presentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def test_full_presentation_flow(self):
finally:
zeroconf.close()

import pdb; pdb.set_trace()
# Start [Client - Target Device Communication]
# Setup presentation server's host and port
self.controller.set_pre_action(flag[0], flag[1])
Expand Down
3 changes: 1 addition & 2 deletions mcts/webapi_tests/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
from mcts.webapi_tests.semiauto import environment

# TODO: need to put presentation api here once fully tested
stingray_test = ['apps', 'device_storage', 'geolocation', 'webrtc',
'notification', 'tcp_socket', 'presentation']
stingray_test = ['apps', 'geolocation', 'webrtc', 'notification', 'tcp_socket', 'presentation']

def iter_tests(start_dir, pattern="test_*.py", mode='phone'):
"""List available Web API tests and yield a tuple of (group, tests),
Expand Down
12 changes: 6 additions & 6 deletions mcts/webapi_tests/semiauto/testcase.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ def setUp(self):
self.assert_browser_connected()
self.marionette = TestCase.create_marionette()

if not certapp.is_installed():
certapp.install(marionette=self.marionette, version=self.version)
# if not certapp.is_installed():
# certapp.install(marionette=self.marionette, version=self.version)

# Make sure we don't reuse the certapp context from a previous
# testrun that was interrupted and left the certapp open.
try:
certapp.kill(self.marionette)
except certapp.CloseError:
self.close_app_manually()
# try:
# certapp.kill(self.marionette)
# except certapp.CloseError:
# self.close_app_manually()

try:
self.app = certapp.launch(self.marionette)
Expand Down
2 changes: 1 addition & 1 deletion mcts/webapi_tests/webrtc/test_webrtc_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class TestWebrtcBasic(TestCase, WebrtcTestCommon):
def setUp(self):
super(TestWebrtcBasic, self).setUp()

def test_basic_wifi_enabled(self):
def test_basic_webrtc(self):
# enable wifi via settings
ret = self.webrtc_message_test()
self.assertEqual(ret, "pc1 said: test from pc2")

0 comments on commit 206c7b8

Please sign in to comment.