Bug 777871 - Get mochitests running OOP in B2G, r=jlebar, DONTBUILD because NPOTB

This commit is contained in:
Jonathan Griffin 2012-08-02 13:30:25 -07:00
Родитель 9b5831023c
Коммит eceb527930
2 изменённых файлов: 15 добавлений и 5 удалений

Просмотреть файл

@ -211,8 +211,11 @@ class B2GRemoteAutomation(Automation):
if 'b2g' not in session:
raise Exception("bad session value %s returned by start_session" % session)
# start the tests by navigating to the mochitest url
self.marionette.execute_script("window.location.href='%s';" % self.testURL)
# Start the tests by navigating to the mochitest url, by setting it
# as the 'src' attribute to the homescreen mozbrowser element
# provided by B2G's shell.js.
self.marionette.set_context("chrome")
self.marionette.execute_script("document.getElementById('homescreen').src='%s';" % self.testURL)
return instance

Просмотреть файл

@ -355,10 +355,17 @@ class B2GMochitest(Mochitest):
testURL += "?" + "&".join(self.urlOpts)
self._automation.testURL = testURL
# Set the B2G homepage as a static local page, since wi-fi generally
# isn't available as soon as the device boots.
# Set extra prefs for B2G.
f = open(os.path.join(options.profilePath, "user.js"), "a")
f.write('user_pref("browser.homescreenURL", "data:text/html,<h1>mochitest-plain should start soon</h1>");\n')
f.write("""
user_pref("browser.homescreenURL","app://system.gaiamobile.org");\n
user_pref("dom.mozBrowserFramesEnabled", true);\n
user_pref("dom.ipc.tabs.disabled", false);\n
user_pref("dom.ipc.browser_frames.oop_by_default", true);\n
user_pref("browser.manifestURL","app://system.gaiamobile.org/manifest.webapp");\n
user_pref("dom.mozBrowserFramesWhitelist","app://system.gaiamobile.org,http://mochi.test:8888");\n
user_pref("network.dns.localDomains","app://system.gaiamobile.org");\n
""")
f.close()
# Copy the profile to the device.