Skip to content

Commit

Permalink
Add support for running the testsuite in Opera
Browse files Browse the repository at this point in the history
  • Loading branch information
gsnedders committed Mar 5, 2012
1 parent 2166dbe commit 5130903
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/resources/opera/operaprefs.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[State]
Accept License=1

18 changes: 17 additions & 1 deletion test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,30 @@ def start(self, url):
"--no-first-run", "--disable-sync", url])
self.process = subprocess.Popen(cmds, stdout = self.browserLog, stderr = self.browserLog)

class OperaBrowserCommand(BaseBrowserCommand):
def _fixupMacPath(self):
self.path = os.path.join(self.path, "Contents", "MacOS", "Opera")

def setup(self):
super(OperaBrowserCommand, self).setup()
shutil.copytree(os.path.join(DOC_ROOT, "test", "resources", "opera"),
self.profileDir)

def start(self, url):
cmds = [self.path]
cmds.extend(["-pd", self.profileDir, "-nosession", url])
print repr(cmds)
self.process = subprocess.Popen(cmds, stdout = self.browserLog, stderr = self.browserLog)

def makeBrowserCommand(browser):
path = browser["path"].lower()
name = browser["name"]
if name is not None:
name = name.lower()

types = {"firefox": FirefoxBrowserCommand,
"chrome": ChromeBrowserCommand }
"chrome": ChromeBrowserCommand,
"opera": OperaBrowserCommand }
command = None
for key in types.keys():
if (name and name.find(key) > -1) or path.find(key) > -1:
Expand Down

0 comments on commit 5130903

Please sign in to comment.