Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
613349b0
Commit
613349b0
authored
11 years ago
by
Georg Fritzsche
Browse files
Options
Downloads
Patches
Plain Diff
Bug 899080 - Test fixup part 1 - Always enable test-plugins for reftests. r=jmaher
parent
63d2cabd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
layout/tools/reftest/reftest.js
+36
-0
36 additions, 0 deletions
layout/tools/reftest/reftest.js
with
36 additions
and
0 deletions
layout/tools/reftest/reftest.js
+
36
−
0
View file @
613349b0
...
...
@@ -109,6 +109,9 @@ var gUnexpectedCrashDumpFiles = { };
var
gCrashDumpDir
;
var
gFailedNoPaint
=
false
;
// The enabled-state of the test-plugins, stored so they can be reset later
var
gTestPluginEnabledStates
=
null
;
const
TYPE_REFTEST_EQUAL
=
'
==
'
;
const
TYPE_REFTEST_NOTEQUAL
=
'
!=
'
;
const
TYPE_LOAD
=
'
load
'
;
// test without a reference (just test that it does
...
...
@@ -208,6 +211,20 @@ function IDForEventTarget(event)
}
}
function
getTestPlugin
(
aName
)
{
var
ph
=
CC
[
"
@mozilla.org/plugin/host;1
"
].
getService
(
CI
.
nsIPluginHost
);
var
tags
=
ph
.
getPluginTags
();
// Find the test plugin
for
(
var
i
=
0
;
i
<
tags
.
length
;
i
++
)
{
if
(
tags
[
i
].
name
==
aName
)
return
tags
[
i
];
}
LogWarning
(
"
Failed to find the test-plugin.
"
);
return
null
;
}
this
.
OnRefTestLoad
=
function
OnRefTestLoad
(
win
)
{
gCrashDumpDir
=
CC
[
NS_DIRECTORY_SERVICE_CONTRACTID
]
...
...
@@ -267,6 +284,17 @@ this.OnRefTestLoad = function OnRefTestLoad(win)
document
.
getElementById
(
"
reftest-window
"
).
appendChild
(
gBrowser
);
#endif
// reftests should have the test plugins enabled, not click-to-play
let
plugin1
=
getTestPlugin
(
"
Test Plug-in
"
);
let
plugin2
=
getTestPlugin
(
"
Second Test Plug-in
"
);
if
(
plugin1
&&
plugin2
)
{
gTestPluginEnabledStates
=
[
plugin1
.
enabledState
,
plugin2
.
enabledState
];
plugin1
.
enabledState
=
CI
.
nsIPluginTag
.
STATE_ENABLED
;
plugin2
.
enabledState
=
CI
.
nsIPluginTag
.
STATE_ENABLED
;
}
else
{
LogWarning
(
"
Could not get test plugin tags.
"
);
}
gBrowserMessageManager
=
gBrowser
.
QueryInterface
(
CI
.
nsIFrameLoaderOwner
)
.
frameLoader
.
messageManager
;
// The content script waits for the initial onload, then notifies
...
...
@@ -498,6 +526,14 @@ function StartTests()
function
OnRefTestUnload
()
{
let
plugin1
=
getTestPlugin
(
"
Test Plug-in
"
);
let
plugin2
=
getTestPlugin
(
"
Second Test Plug-in
"
);
if
(
plugin1
&&
plugin2
)
{
plugin1
.
enabledState
=
gTestPluginEnabledStates
[
0
];
plugin2
.
enabledState
=
gTestPluginEnabledStates
[
1
];
}
else
{
LogWarning
(
"
Failed to get test plugin tags.
"
);
}
}
// Read all available data from an input stream and return it
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment