зеркало из https://github.com/mozilla/gecko-dev.git
merge autoland to mozilla-central a=merge
This commit is contained in:
Коммит
668b63cbb9
|
@ -23,7 +23,7 @@ const kWhitelist = [
|
|||
{sourceName: /loop\/.*\.css$/i,
|
||||
errorMessage: /Unknown pseudo-class.*placeholder/i},
|
||||
{sourceName: /loop\/.*shared\/css\/common.css$/i,
|
||||
errorMessage: /Unknown property 'user-select'/i},
|
||||
errorMessage: /Unknown property .user-select./i},
|
||||
// Highlighter CSS uses a UA-only pseudo-class, see bug 985597.
|
||||
{sourceName: /highlighters\.css$/i,
|
||||
errorMessage: /Unknown pseudo-class.*moz-native-anonymous/i},
|
||||
|
|
|
@ -70,7 +70,8 @@ function iterateOverPath(path, extensions) {
|
|||
let uriSpec = getURLForFile(file);
|
||||
files.push(Services.io.newURI(uriSpec, null, null));
|
||||
}
|
||||
} else if (entry.name.endsWith(".ja") || entry.name.endsWith(".jar")) {
|
||||
} else if (entry.name.endsWith(".ja") || entry.name.endsWith(".jar") ||
|
||||
entry.name.endsWith(".zip") || entry.name.endsWith(".xpi")) {
|
||||
let file = parentDir.clone();
|
||||
file.append(entry.name);
|
||||
for (let extension of extensions) {
|
||||
|
|
|
@ -51,6 +51,7 @@ SEARCH_PATHS = [
|
|||
'python/pyyaml/lib',
|
||||
'python/requests',
|
||||
'python/slugid',
|
||||
'python/voluptuous',
|
||||
'build',
|
||||
'build/pymake',
|
||||
'config',
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[DEFAULT]
|
||||
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s
|
||||
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) || e10s || toolkit == 'android' # Bug 1287720: takes too long on android
|
||||
|
||||
support-files =
|
||||
audio.ogg
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[DEFAULT]
|
||||
|
||||
skip-if = toolkit == 'android' # Bug 1287455: takes too long to complete on Android
|
||||
support-files =
|
||||
shared.js
|
||||
file_contacts_basics.html
|
||||
|
@ -20,11 +20,11 @@ support-files =
|
|||
# did opened the database. those should really be xpcshell and not chrome
|
||||
# mochitests maybe ...
|
||||
[test_contacts_a_shutdown.xul]
|
||||
skip-if = os == "android" || buildapp == 'b2g'
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_contacts_a_upgrade.xul]
|
||||
skip-if = os == "android" || buildapp == 'b2g'
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_contacts_a_cache.xul]
|
||||
skip-if = os == "android" || buildapp == 'b2g'
|
||||
skip-if = buildapp == 'b2g'
|
||||
[test_contacts_basics.html]
|
||||
skip-if = (toolkit == 'gonk' && debug) #debug-only failure
|
||||
[test_contacts_basics2.html]
|
||||
|
@ -42,4 +42,3 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure
|
|||
[test_contacts_substringmatchingCL.html]
|
||||
[test_migration.html]
|
||||
support-files +=
|
||||
skip-if = os == "android"
|
||||
|
|
|
@ -4714,12 +4714,10 @@ void HTMLMediaElement::SuspendOrResumeElement(bool aPauseElement, bool aSuspendE
|
|||
UpdateSrcMediaStreamPlaying();
|
||||
UpdateAudioChannelPlayingState();
|
||||
if (aPauseElement) {
|
||||
if (mMediaSource) {
|
||||
ReportTelemetry();
|
||||
ReportTelemetry();
|
||||
#ifdef MOZ_EME
|
||||
ReportEMETelemetry();
|
||||
ReportEMETelemetry();
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef MOZ_EME
|
||||
// For EME content, force destruction of the CDM client (and CDM
|
||||
|
|
|
@ -8946,7 +8946,7 @@ public:
|
|||
{
|
||||
AssertIsOnBackgroundThread();
|
||||
MOZ_ASSERT(aMaintenance);
|
||||
MOZ_ASSERT(mCurrentMaintenance = aMaintenance);
|
||||
MOZ_ASSERT(mCurrentMaintenance == aMaintenance);
|
||||
|
||||
mCurrentMaintenance = nullptr;
|
||||
ProcessMaintenanceQueue();
|
||||
|
|
|
@ -167,7 +167,12 @@ cubeb* GetCubebContextUnlocked()
|
|||
return sCubebContext;
|
||||
}
|
||||
|
||||
NS_WARN_IF_FALSE(sBrandName, "Could not get brandName?");
|
||||
if (!sBrandName && NS_IsMainThread()) {
|
||||
InitBrandName();
|
||||
} else {
|
||||
NS_WARN_IF_FALSE(sBrandName,
|
||||
"Did not initialize sbrandName, and not on the main thread?");
|
||||
}
|
||||
|
||||
DebugOnly<int> rv = cubeb_init(&sCubebContext, sBrandName);
|
||||
NS_WARN_IF_FALSE(rv == CUBEB_OK, "Could not get a cubeb context.");
|
||||
|
|
|
@ -609,6 +609,7 @@ tags=capturestream
|
|||
skip-if = os == 'win' && !debug # bug 1140675
|
||||
[test_bug883173.html]
|
||||
[test_bug895091.html]
|
||||
tags=webvtt
|
||||
[test_bug895305.html]
|
||||
[test_bug919265.html]
|
||||
[test_bug957847.html]
|
||||
|
|
|
@ -344,6 +344,13 @@ SpeechDispatcherService::Setup()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!PR_FindFunctionSymbol(speechdLib, "spd_get_volume")) {
|
||||
// There is no version getter function, so we rely on a symbol that was
|
||||
// introduced in release 0.8.2 in order to check for ABI compatibility.
|
||||
NS_WARNING("Unsupported version of speechd detected");
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint32_t i = 0; i < ArrayLength(kSpeechDispatcherSymbols); i++) {
|
||||
*kSpeechDispatcherSymbols[i].function =
|
||||
PR_FindFunctionSymbol(speechdLib, kSpeechDispatcherSymbols[i].functionName);
|
||||
|
|
|
@ -177,7 +177,7 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
|
|||
"Malformed timestamp: " + oInput);
|
||||
}
|
||||
// Remove time stamp from input.
|
||||
input = input.replace(/^[^\sa-zA-Z-]+/, "");
|
||||
input = input.replace(/^[^\s\uFFFDa-zA-Z-]+/, "");
|
||||
return ts;
|
||||
}
|
||||
|
||||
|
@ -259,6 +259,18 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
|
|||
consumeCueSettings(input, cue);
|
||||
}
|
||||
|
||||
function onlyContainsWhiteSpaces(input) {
|
||||
return /^[ \f\n\r\t]+$/.test(input);
|
||||
}
|
||||
|
||||
function containsTimeDirectionSymbol(input) {
|
||||
return input.indexOf("-->") !== -1;
|
||||
}
|
||||
|
||||
function maybeIsTimeStampFormat(input) {
|
||||
return /^\s*(\d+:)?(\d{2}):(\d{2})\.(\d+)\s*-->\s*(\d+:)?(\d{2}):(\d{2})\.(\d+)\s*/.test(input);
|
||||
}
|
||||
|
||||
var ESCAPE = {
|
||||
"&": "&",
|
||||
"<": "<",
|
||||
|
@ -1254,7 +1266,44 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
|
|||
++pos;
|
||||
}
|
||||
self.buffer = buffer.substr(pos);
|
||||
return line;
|
||||
// Spec defined replacement.
|
||||
return line.replace(/[\u0000]/g, "\uFFFD");
|
||||
}
|
||||
|
||||
function createCueIfNeeded() {
|
||||
if (!self.cue) {
|
||||
self.cue = new self.window.VTTCue(0, 0, "");
|
||||
}
|
||||
}
|
||||
|
||||
// Parsing cue identifier and the identifier should be unique.
|
||||
// Return true if the input is a cue identifier.
|
||||
function parseCueIdentifier(input) {
|
||||
if (maybeIsTimeStampFormat(line)) {
|
||||
self.state = "CUE";
|
||||
return false;
|
||||
}
|
||||
|
||||
createCueIfNeeded();
|
||||
// TODO : ensure the cue identifier is unique among all cue identifiers.
|
||||
self.cue.id = containsTimeDirectionSymbol(input) ? "" : input;
|
||||
self.state = "CUE";
|
||||
return true;
|
||||
}
|
||||
|
||||
// Parsing the timestamp and cue settings.
|
||||
// See spec, https://w3c.github.io/webvtt/#collect-webvtt-cue-timings-and-settings
|
||||
function parseCueMayThrow(input) {
|
||||
try {
|
||||
createCueIfNeeded();
|
||||
parseCue(input, self.cue, self.regionList);
|
||||
self.state = "CUETEXT";
|
||||
} catch (e) {
|
||||
self.reportOrThrowError(e);
|
||||
// In case of an error ignore rest of the cue.
|
||||
self.cue = null;
|
||||
self.state = "BADCUE";
|
||||
}
|
||||
}
|
||||
|
||||
// 3.4 WebVTT region and WebVTT region settings syntax
|
||||
|
@ -1317,120 +1366,124 @@ this.EXPORTED_SYMBOLS = ["WebVTT"];
|
|||
}
|
||||
}
|
||||
|
||||
// WebVTT parser algorithm step1 - step9.
|
||||
function parseSignature(input) {
|
||||
// Parsing the WebVTT signature, it contains parsing algo step1 to step9.
|
||||
// See spec, https://w3c.github.io/webvtt/#file-parsing
|
||||
function parseSignatureMayThrow(input) {
|
||||
let signature = collectNextLine();
|
||||
if (!/^WEBVTT([ \t].*)?$/.test(signature)) {
|
||||
throw new ParsingError(ParsingError.Errors.BadSignature);
|
||||
} else {
|
||||
self.state = "HEADER";
|
||||
}
|
||||
}
|
||||
|
||||
// 3.2 WebVTT metadata header syntax
|
||||
function parseHeader(input) {
|
||||
parseOptions(input, function (k, v) {
|
||||
switch (k) {
|
||||
case "Region":
|
||||
// 3.3 WebVTT region metadata header syntax
|
||||
parseRegion(v);
|
||||
// Parsing the region and style information.
|
||||
// See spec, https://w3c.github.io/webvtt/#collect-a-webvtt-block
|
||||
//
|
||||
// There are sereval things would appear in header,
|
||||
// 1. Region or Style setting
|
||||
// 2. Garbage (meaningless string)
|
||||
// 3. Empty line
|
||||
// 4. Cue's timestamp
|
||||
// The case 4 happens when there is no line interval between the header
|
||||
// and the cue blocks. In this case, we should preserve the line and
|
||||
// return it for the next phase parsing.
|
||||
function parseHeader() {
|
||||
let line = null;
|
||||
while (self.buffer && self.state === "HEADER") {
|
||||
line = collectNextLine();
|
||||
|
||||
if (/^REGION|^STYLE/i.test(line)) {
|
||||
parseOptions(line, function (k, v) {
|
||||
switch (k.toUpperCase()) {
|
||||
case "REGION":
|
||||
parseRegion(v);
|
||||
break;
|
||||
case "STYLE":
|
||||
// TODO : not supported yet.
|
||||
break;
|
||||
}
|
||||
}, ":");
|
||||
} else if (maybeIsTimeStampFormat(line)) {
|
||||
self.state = "CUE";
|
||||
break;
|
||||
} else if (!line ||
|
||||
onlyContainsWhiteSpaces(line) ||
|
||||
containsTimeDirectionSymbol(line)) {
|
||||
// empty line, whitespaces or string contains "-->"
|
||||
break;
|
||||
}
|
||||
}, /:/);
|
||||
}
|
||||
|
||||
// End parsing header part and doesn't see the timestamp.
|
||||
if (self.state === "HEADER") {
|
||||
self.state = "ID";
|
||||
line = null
|
||||
}
|
||||
return line;
|
||||
}
|
||||
|
||||
// 5.1 WebVTT file parsing.
|
||||
try {
|
||||
if (self.state === "INITIAL") {
|
||||
parseSignature();
|
||||
self.state = "HEADER";
|
||||
parseSignatureMayThrow();
|
||||
}
|
||||
|
||||
var line;
|
||||
var alreadyCollectedLine = false;
|
||||
while (self.buffer) {
|
||||
// We can't parse a line until we have the full line.
|
||||
if (!/\r\n|\n/.test(self.buffer)) {
|
||||
return this;
|
||||
}
|
||||
if (self.state === "HEADER") {
|
||||
line = parseHeader();
|
||||
}
|
||||
|
||||
if (!alreadyCollectedLine) {
|
||||
while (self.buffer) {
|
||||
if (!line) {
|
||||
// Since the data receiving is async, we need to wait until the
|
||||
// buffer gets the full line.
|
||||
if (!/\r\n|\n/.test(self.buffer)) {
|
||||
return this;
|
||||
}
|
||||
line = collectNextLine();
|
||||
} else {
|
||||
alreadyCollectedLine = false;
|
||||
}
|
||||
|
||||
switch (self.state) {
|
||||
case "HEADER":
|
||||
// 13-18 - Allow a header (metadata) under the WEBVTT line.
|
||||
if (/:/.test(line)) {
|
||||
parseHeader(line);
|
||||
} else if (!line) {
|
||||
// An empty line terminates the header and starts the body (cues).
|
||||
self.state = "ID";
|
||||
}
|
||||
continue;
|
||||
case "NOTE":
|
||||
// Ignore NOTE blocks.
|
||||
if (!line) {
|
||||
self.state = "ID";
|
||||
}
|
||||
continue;
|
||||
case "ID":
|
||||
// Check for the start of NOTE blocks.
|
||||
if (/^NOTE($|[ \t])/.test(line)) {
|
||||
self.state = "NOTE";
|
||||
// Ignore NOTE and line terminator
|
||||
if (/^NOTE($|[ \t])/.test(line) || !line) {
|
||||
break;
|
||||
}
|
||||
// 19-29 - Allow any number of line terminators, then initialize new cue values.
|
||||
if (!line) {
|
||||
// If there is no cue identifier, keep the line and reuse this line
|
||||
// in next iteration.
|
||||
if (!parseCueIdentifier(line)) {
|
||||
continue;
|
||||
}
|
||||
self.cue = new self.window.VTTCue(0, 0, "");
|
||||
self.state = "CUE";
|
||||
// 30-39 - Check if self line contains an optional identifier or timing data.
|
||||
if (line.indexOf("-->") === -1) {
|
||||
self.cue.id = line;
|
||||
continue;
|
||||
}
|
||||
// Process line as start of a cue.
|
||||
/*falls through*/
|
||||
break;
|
||||
case "CUE":
|
||||
// 40 - Collect cue timings and settings.
|
||||
try {
|
||||
parseCue(line, self.cue, self.regionList);
|
||||
} catch (e) {
|
||||
self.reportOrThrowError(e);
|
||||
// In case of an error ignore rest of the cue.
|
||||
self.cue = null;
|
||||
self.state = "BADCUE";
|
||||
continue;
|
||||
}
|
||||
self.state = "CUETEXT";
|
||||
continue;
|
||||
parseCueMayThrow(line);
|
||||
break;
|
||||
case "CUETEXT":
|
||||
var hasSubstring = line.indexOf("-->") !== -1;
|
||||
// 34 - If we have an empty line then report the cue.
|
||||
// 35 - If we have the special substring '-->' then report the cue,
|
||||
// but do not collect the line as we need to process the current
|
||||
// one as a new cue.
|
||||
if (!line || hasSubstring && (alreadyCollectedLine = true)) {
|
||||
// Report the cue when (1) get an empty line (2) get the "-->""
|
||||
if (!line || containsTimeDirectionSymbol(line)) {
|
||||
// We are done parsing self cue.
|
||||
self.oncue && self.oncue(self.cue);
|
||||
self.cue = null;
|
||||
self.state = "ID";
|
||||
// Keep the line and reuse this line in next iteration.
|
||||
continue;
|
||||
}
|
||||
if (self.cue.text) {
|
||||
self.cue.text += "\n";
|
||||
}
|
||||
self.cue.text += line;
|
||||
continue;
|
||||
break;
|
||||
case "BADCUE": // BADCUE
|
||||
// 54-62 - Collect and discard the remaining cue.
|
||||
if (!line) {
|
||||
self.state = "ID";
|
||||
}
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
// The line was already parsed, empty it to ensure we can get the
|
||||
// new line in next iteration.
|
||||
line = null;
|
||||
}
|
||||
} catch (e) {
|
||||
self.reportOrThrowError(e);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[DEFAULT]
|
||||
skip-if = toolkit == 'android' # Bug 1287455: takes too long to complete on Android
|
||||
support-files =
|
||||
file_loadserver.js
|
||||
file_bug1110872.js
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[DEFAULT]
|
||||
|
||||
skip-if = toolkit == 'android' # Bug 1287455: takes too long to complete on Android
|
||||
support-files =
|
||||
MockServices.js
|
||||
NotificationTest.js
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
[DEFAULT]
|
||||
skip-if = toolkit == 'android' # Bug 1287455: takes too long to complete on Android
|
||||
support-files =
|
||||
head.js
|
||||
mock_data.json
|
||||
|
|
|
@ -390,16 +390,24 @@ RecordedDrawingEvent::GetObjectRef() const
|
|||
return mDT;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedDrawTargetCreation::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<DrawTarget> newDT =
|
||||
aTranslator->CreateDrawTarget(mRefPtr, mSize, mFormat);
|
||||
|
||||
if (newDT && mHasExistingData) {
|
||||
// If we couldn't create a DrawTarget this will probably cause us to crash
|
||||
// with nullptr later in the playback, so return false to abort.
|
||||
if (!newDT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (mHasExistingData) {
|
||||
Rect dataRect(0, 0, mExistingData->GetSize().width, mExistingData->GetSize().height);
|
||||
newDT->DrawSurface(mExistingData, dataRect, dataRect);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -455,10 +463,11 @@ RecordedDrawTargetCreation::OutputSimpleEventInfo(stringstream &aStringStream) c
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedDrawTargetDestruction::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->RemoveDrawTarget(mRefPtr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -479,12 +488,20 @@ RecordedDrawTargetDestruction::OutputSimpleEventInfo(stringstream &aStringStream
|
|||
aStringStream << "[" << mRefPtr << "] DrawTarget Destruction";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedCreateSimilarDrawTarget::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<DrawTarget> newDT =
|
||||
aTranslator->GetReferenceDrawTarget()->CreateSimilarDrawTarget(mSize, mFormat);
|
||||
|
||||
// If we couldn't create a DrawTarget this will probably cause us to crash
|
||||
// with nullptr later in the playback, so return false to abort.
|
||||
if (!newDT) {
|
||||
return false;
|
||||
}
|
||||
|
||||
aTranslator->AddDrawTarget(mRefPtr, newDT);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -575,10 +592,11 @@ struct GenericPattern
|
|||
Translator *mTranslator;
|
||||
};
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFillRect::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->FillRect(mRect, *GenericPattern(mPattern, aTranslator), mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -605,10 +623,11 @@ RecordedFillRect::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
OutputSimplePatternInfo(mPattern, aStringStream);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedStrokeRect::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->StrokeRect(mRect, *GenericPattern(mPattern, aTranslator), mStrokeOptions, mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -638,10 +657,11 @@ RecordedStrokeRect::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
OutputSimplePatternInfo(mPattern, aStringStream);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedStrokeLine::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->StrokeLine(mBegin, mEnd, *GenericPattern(mPattern, aTranslator), mStrokeOptions, mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -673,10 +693,11 @@ RecordedStrokeLine::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
OutputSimplePatternInfo(mPattern, aStringStream);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFill::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->Fill(aTranslator->LookupPath(mPath), *GenericPattern(mPattern, aTranslator), mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
RecordedFill::RecordedFill(istream &aStream)
|
||||
|
@ -708,13 +729,14 @@ RecordedFillGlyphs::~RecordedFillGlyphs()
|
|||
delete [] mGlyphs;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFillGlyphs::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
GlyphBuffer buffer;
|
||||
buffer.mGlyphs = mGlyphs;
|
||||
buffer.mNumGlyphs = mNumGlyphs;
|
||||
aTranslator->LookupDrawTarget(mDT)->FillGlyphs(aTranslator->LookupScaledFont(mScaledFont), buffer, *GenericPattern(mPattern, aTranslator), mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
RecordedFillGlyphs::RecordedFillGlyphs(istream &aStream)
|
||||
|
@ -746,10 +768,11 @@ RecordedFillGlyphs::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
OutputSimplePatternInfo(mPattern, aStringStream);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedMask::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->Mask(*GenericPattern(mSource, aTranslator), *GenericPattern(mMask, aTranslator), mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
RecordedMask::RecordedMask(istream &aStream)
|
||||
|
@ -778,10 +801,11 @@ RecordedMask::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
OutputSimplePatternInfo(mMask, aStringStream);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedStroke::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->Stroke(aTranslator->LookupPath(mPath), *GenericPattern(mPattern, aTranslator), mStrokeOptions, mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -810,10 +834,11 @@ RecordedStroke::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
OutputSimplePatternInfo(mPattern, aStringStream);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedClearRect::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->ClearRect(mRect);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -835,11 +860,12 @@ RecordedClearRect::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT<< "] ClearRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedCopySurface::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->CopySurface(aTranslator->LookupSourceSurface(mSourceSurface),
|
||||
mSourceRect, mDest);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -865,10 +891,11 @@ RecordedCopySurface::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT<< "] CopySurface (" << mSourceSurface << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedPushClip::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->PushClip(aTranslator->LookupPath(mPath));
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -890,10 +917,11 @@ RecordedPushClip::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT << "] PushClip (" << mPath << ") ";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedPushClipRect::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->PushClipRect(mRect);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -915,10 +943,11 @@ RecordedPushClipRect::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT << "] PushClipRect (" << mRect.x << ", " << mRect.y << " - " << mRect.width << " x " << mRect.height << ") ";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedPopClip::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->PopClip();
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -938,13 +967,14 @@ RecordedPopClip::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT << "] PopClip";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedPushLayer::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
SourceSurface* mask = mMask ? aTranslator->LookupSourceSurface(mMask)
|
||||
: nullptr;
|
||||
aTranslator->LookupDrawTarget(mDT)->
|
||||
PushLayer(mOpaque, mOpacity, mask, mMaskTransform, mBounds, mCopyBackground);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -977,10 +1007,11 @@ RecordedPushLayer::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
", Opacity=" << mOpacity << ", Mask Ref=" << mMask << ") ";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedPopLayer::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->PopLayer();
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1000,10 +1031,11 @@ RecordedPopLayer::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT << "] PopLayer";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedSetTransform::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->SetTransform(mTransform);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1026,12 +1058,13 @@ RecordedSetTransform::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
mTransform._21 << " " << mTransform._22 << " ; " << mTransform._31 << " " << mTransform._32 << " ]";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedDrawSurface::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->
|
||||
DrawSurface(aTranslator->LookupSourceSurface(mRefSource), mDest, mSource,
|
||||
mDSOptions, mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1061,12 +1094,13 @@ RecordedDrawSurface::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT << "] DrawSurface (" << mRefSource << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedDrawFilter::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->
|
||||
DrawFilter(aTranslator->LookupFilterNode(mNode), mSourceRect,
|
||||
mDestPoint, mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1094,12 +1128,13 @@ RecordedDrawFilter::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
aStringStream << "[" << mDT << "] DrawFilter (" << mNode << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedDrawSurfaceWithShadow::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->
|
||||
DrawSurfaceWithShadow(aTranslator->LookupSourceSurface(mRefSource),
|
||||
mDest, mColor, mOffset, mSigma, mOp);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1141,7 +1176,7 @@ RecordedPathCreation::~RecordedPathCreation()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedPathCreation::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<PathBuilder> builder =
|
||||
|
@ -1170,6 +1205,7 @@ RecordedPathCreation::PlayEvent(Translator *aTranslator) const
|
|||
|
||||
RefPtr<Path> path = builder->Finish();
|
||||
aTranslator->AddPath(mRefPtr, path);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1226,10 +1262,11 @@ RecordedPathCreation::OutputSimpleEventInfo(stringstream &aStringStream) const
|
|||
{
|
||||
aStringStream << "[" << mRefPtr << "] Path created (OpCount: " << mPathOps.size() << ")";
|
||||
}
|
||||
void
|
||||
bool
|
||||
RecordedPathDestruction::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->RemovePath(mRefPtr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1257,12 +1294,13 @@ RecordedSourceSurfaceCreation::~RecordedSourceSurfaceCreation()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedSourceSurfaceCreation::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<SourceSurface> src = aTranslator->GetReferenceDrawTarget()->
|
||||
CreateSourceSurfaceFromData(mData, mSize, mSize.width * BytesPerPixel(mFormat), mFormat);
|
||||
aTranslator->AddSourceSurface(mRefPtr, src);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1292,10 +1330,11 @@ RecordedSourceSurfaceCreation::OutputSimpleEventInfo(stringstream &aStringStream
|
|||
aStringStream << "[" << mRefPtr << "] SourceSurface created (Size: " << mSize.width << "x" << mSize.height << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedSourceSurfaceDestruction::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->RemoveSourceSurface(mRefPtr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1320,12 +1359,13 @@ RecordedFilterNodeCreation::~RecordedFilterNodeCreation()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFilterNodeCreation::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<FilterNode> node = aTranslator->GetReferenceDrawTarget()->
|
||||
CreateFilter(mType);
|
||||
aTranslator->AddFilterNode(mRefPtr, node);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1348,10 +1388,11 @@ RecordedFilterNodeCreation::OutputSimpleEventInfo(stringstream &aStringStream) c
|
|||
aStringStream << "[" << mRefPtr << "] FilterNode created (Type: " << int(mType) << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFilterNodeDestruction::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->RemoveFilterNode(mRefPtr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1379,12 +1420,13 @@ RecordedGradientStopsCreation::~RecordedGradientStopsCreation()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedGradientStopsCreation::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<GradientStops> src = aTranslator->GetReferenceDrawTarget()->
|
||||
CreateGradientStops(mStops, mNumStops, mExtendMode);
|
||||
aTranslator->AddGradientStops(mRefPtr, src);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1413,10 +1455,11 @@ RecordedGradientStopsCreation::OutputSimpleEventInfo(stringstream &aStringStream
|
|||
aStringStream << "[" << mRefPtr << "] GradientStops created (Stops: " << mNumStops << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedGradientStopsDestruction::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->RemoveGradientStops(mRefPtr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1437,11 +1480,12 @@ RecordedGradientStopsDestruction::OutputSimpleEventInfo(stringstream &aStringStr
|
|||
aStringStream << "[" << mRefPtr << "] GradientStops Destroyed";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedSnapshot::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<SourceSurface> src = aTranslator->LookupDrawTarget(mDT)->Snapshot();
|
||||
aTranslator->AddSourceSurface(mRefPtr, src);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1469,13 +1513,14 @@ RecordedFontData::~RecordedFontData()
|
|||
delete[] mData;
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFontData::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
RefPtr<NativeFontResource> fontResource =
|
||||
Factory::CreateNativeFontResource(mData, mFontDetails.size,
|
||||
aTranslator->GetDesiredFontType());
|
||||
aTranslator->AddNativeFontResource(mFontDetails.fontDataKey, fontResource);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1532,7 +1577,7 @@ RecordedFontDescriptor::~RecordedFontDescriptor()
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFontDescriptor::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
MOZ_ASSERT(mType == FontType::GDI);
|
||||
|
@ -1549,6 +1594,7 @@ RecordedFontDescriptor::PlayEvent(Translator *aTranslator) const
|
|||
#endif
|
||||
|
||||
aTranslator->AddScaledFont(mRefPtr, font);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1588,12 +1634,13 @@ RecordedFontDescriptor::RecordedFontDescriptor(istream &aStream)
|
|||
aStream.read((char*)&mData[0], size);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedScaledFontCreation::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
NativeFontResource *fontResource = aTranslator->LookupNativeFontResource(mFontDataKey);
|
||||
RefPtr<ScaledFont> scaledFont = fontResource->CreateScaledFont(mIndex, mGlyphSize);
|
||||
aTranslator->AddScaledFont(mRefPtr, scaledFont);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1620,10 +1667,11 @@ RecordedScaledFontCreation::RecordedScaledFontCreation(istream &aStream)
|
|||
ReadElement(aStream, mGlyphSize);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedScaledFontDestruction::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->RemoveScaledFont(mRefPtr);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1644,13 +1692,14 @@ RecordedScaledFontDestruction::OutputSimpleEventInfo(stringstream &aStringStream
|
|||
aStringStream << "[" << mRefPtr << "] ScaledFont Destroyed";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedMaskSurface::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
aTranslator->LookupDrawTarget(mDT)->
|
||||
MaskSurface(*GenericPattern(mPattern, aTranslator),
|
||||
aTranslator->LookupSourceSurface(mRefMask),
|
||||
mOffset, mOptions);
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1686,7 +1735,7 @@ ReplaySetAttribute(FilterNode *aNode, uint32_t aIndex, T aValue)
|
|||
aNode->SetAttribute(aIndex, aValue);
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFilterNodeSetAttribute::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
#define REPLAY_SET_ATTRIBUTE(type, argtype) \
|
||||
|
@ -1715,6 +1764,8 @@ RecordedFilterNodeSetAttribute::PlayEvent(Translator *aTranslator) const
|
|||
mPayload.size() / sizeof(Float));
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1746,7 +1797,7 @@ RecordedFilterNodeSetAttribute::OutputSimpleEventInfo(stringstream &aStringStrea
|
|||
aStringStream << "[" << mNode << "] SetAttribute (" << mIndex << ")";
|
||||
}
|
||||
|
||||
void
|
||||
bool
|
||||
RecordedFilterNodeSetInput::PlayEvent(Translator *aTranslator) const
|
||||
{
|
||||
if (mInputFilter) {
|
||||
|
@ -1756,6 +1807,8 @@ RecordedFilterNodeSetInput::PlayEvent(Translator *aTranslator) const
|
|||
aTranslator->LookupFilterNode(mNode)->SetInput(
|
||||
mIndex, aTranslator->LookupSourceSurface(mInputSurface));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -202,7 +202,15 @@ public:
|
|||
|
||||
static std::string GetEventName(EventType aType);
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const {}
|
||||
/**
|
||||
* Play back this event using the translator. Note that derived classes should
|
||||
* only return false when there is a fatal error, as it will probably mean the
|
||||
* translation will abort.
|
||||
* @param aTranslator Translator to be used for retrieving other referenced
|
||||
* objects and making playback decisions.
|
||||
* @return true unless a fatal problem has occurred and playback should abort.
|
||||
*/
|
||||
virtual bool PlayEvent(Translator *aTranslator) const { return true; }
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const {}
|
||||
|
||||
|
@ -262,7 +270,7 @@ public:
|
|||
, mHasExistingData(aHasExistingData), mExistingData(aExistingData)
|
||||
{}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -289,7 +297,7 @@ public:
|
|||
: RecordedEvent(DRAWTARGETDESTRUCTION), mRefPtr(aRefPtr)
|
||||
{}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -316,7 +324,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -342,7 +350,7 @@ public:
|
|||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -368,7 +376,7 @@ public:
|
|||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -396,7 +404,7 @@ public:
|
|||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -422,7 +430,7 @@ public:
|
|||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -451,7 +459,7 @@ public:
|
|||
}
|
||||
virtual ~RecordedFillGlyphs();
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -478,7 +486,7 @@ public:
|
|||
StorePattern(mMask, aMask);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -504,7 +512,7 @@ public:
|
|||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -528,7 +536,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -551,7 +559,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -574,7 +582,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -595,7 +603,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -615,7 +623,7 @@ public:
|
|||
: RecordedDrawingEvent(POPCLIP, aDT)
|
||||
{}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -638,7 +646,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -664,7 +672,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -683,7 +691,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -707,7 +715,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -735,7 +743,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -765,7 +773,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -787,7 +795,7 @@ public:
|
|||
MOZ_IMPLICIT RecordedPathCreation(PathRecording *aPath);
|
||||
~RecordedPathCreation();
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -811,7 +819,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -837,7 +845,7 @@ public:
|
|||
|
||||
~RecordedSourceSurfaceCreation();
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -864,7 +872,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -888,7 +896,7 @@ public:
|
|||
|
||||
~RecordedFilterNodeCreation();
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -911,7 +919,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -937,7 +945,7 @@ public:
|
|||
|
||||
~RecordedGradientStopsCreation();
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -963,7 +971,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -985,7 +993,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -1019,7 +1027,7 @@ public:
|
|||
|
||||
~RecordedFontData();
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -1065,7 +1073,7 @@ public:
|
|||
|
||||
bool IsValid() const { return mHasDesc; }
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -1099,7 +1107,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -1125,7 +1133,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -1150,7 +1158,7 @@ public:
|
|||
StorePattern(mPattern, aPattern);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
@ -1202,7 +1210,7 @@ public:
|
|||
memcpy(&mPayload.front(), aFloat, sizeof(Float) * aSize);
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
||||
|
@ -1237,7 +1245,7 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
virtual void PlayEvent(Translator *aTranslator) const;
|
||||
virtual bool PlayEvent(Translator *aTranslator) const;
|
||||
virtual void RecordToStream(std::ostream &aStream) const;
|
||||
virtual void OutputSimpleEventInfo(std::stringstream &aStringStream) const;
|
||||
|
||||
|
|
|
@ -641,8 +641,9 @@ _cairo_dwrite_scaled_show_glyphs(void *scaled_font,
|
|||
run.fontEmSize = 1.0f;
|
||||
}
|
||||
|
||||
HRESULT hr;
|
||||
if (!transform) {
|
||||
DWriteFactory::Instance()->CreateGlyphRunAnalysis(&run,
|
||||
hr = DWriteFactory::Instance()->CreateGlyphRunAnalysis(&run,
|
||||
1.0f,
|
||||
NULL,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
|
||||
|
@ -652,7 +653,7 @@ _cairo_dwrite_scaled_show_glyphs(void *scaled_font,
|
|||
&analysis);
|
||||
} else {
|
||||
DWRITE_MATRIX dwmatrix = _cairo_dwrite_matrix_from_matrix(&dwritesf->mat);
|
||||
DWriteFactory::Instance()->CreateGlyphRunAnalysis(&run,
|
||||
hr = DWriteFactory::Instance()->CreateGlyphRunAnalysis(&run,
|
||||
1.0f,
|
||||
&dwmatrix,
|
||||
DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC,
|
||||
|
@ -662,6 +663,10 @@ _cairo_dwrite_scaled_show_glyphs(void *scaled_font,
|
|||
&analysis);
|
||||
}
|
||||
|
||||
if (FAILED(hr) || !analysis) {
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
}
|
||||
|
||||
RECT r;
|
||||
r.left = 0;
|
||||
r.top = 0;
|
||||
|
|
|
@ -292,11 +292,10 @@ XPCWrappedNativeScope::EnsureContentXBLScope(JSContext* cx)
|
|||
|
||||
// Use an nsExpandedPrincipal to create asymmetric security.
|
||||
nsIPrincipal* principal = GetPrincipal();
|
||||
nsCOMPtr<nsIExpandedPrincipal> ep;
|
||||
MOZ_ASSERT(!(ep = do_QueryInterface(principal)));
|
||||
MOZ_ASSERT(!nsContentUtils::IsExpandedPrincipal(principal));
|
||||
nsTArray< nsCOMPtr<nsIPrincipal> > principalAsArray(1);
|
||||
principalAsArray.AppendElement(principal);
|
||||
ep = new nsExpandedPrincipal(principalAsArray);
|
||||
nsCOMPtr<nsIExpandedPrincipal> ep = new nsExpandedPrincipal(principalAsArray);
|
||||
|
||||
// Create the sandbox.
|
||||
RootedValue v(cx);
|
||||
|
|
|
@ -3264,7 +3264,7 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
// its descendants, yet RestyleSelf might return different RestyleResult
|
||||
// values for the different same-style continuations. |result| is our
|
||||
// overall decision.
|
||||
RestyleResult result = RestyleResult(0);
|
||||
RestyleResult result = RestyleResult::eNone;
|
||||
uint32_t swappedStructs = 0;
|
||||
|
||||
nsRestyleHint thisRestyleHint = aRestyleHint;
|
||||
|
@ -3274,15 +3274,15 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
RestyleResult thisResult =
|
||||
RestyleSelf(f, thisRestyleHint, &swappedStructs, swaps);
|
||||
|
||||
if (thisResult != eRestyleResult_Stop) {
|
||||
if (thisResult != RestyleResult::eStop) {
|
||||
// Calls to RestyleSelf for later same-style continuations must not
|
||||
// return eRestyleResult_Stop, so pass eRestyle_Force in to them.
|
||||
// return RestyleResult::eStop, so pass eRestyle_Force in to them.
|
||||
thisRestyleHint = nsRestyleHint(thisRestyleHint | eRestyle_Force);
|
||||
|
||||
if (result == eRestyleResult_Stop) {
|
||||
// We received eRestyleResult_Stop for earlier same-style
|
||||
// continuations, and eRestyleResult_StopWithStyleChange or
|
||||
// eRestyleResult_Continue(AndForceDescendants) for this one; go
|
||||
if (result == RestyleResult::eStop) {
|
||||
// We received RestyleResult::eStop for earlier same-style
|
||||
// continuations, and RestyleResult::eStopWithStyleChange or
|
||||
// RestyleResult::eContinue(AndForceDescendants) for this one; go
|
||||
// back and force-restyle the earlier continuations.
|
||||
result = thisResult;
|
||||
f = mFrame;
|
||||
|
@ -3321,14 +3321,14 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
hintToRestore, nsChangeHint(0));
|
||||
}
|
||||
|
||||
if (result == eRestyleResult_Stop) {
|
||||
if (result == RestyleResult::eStop) {
|
||||
MOZ_ASSERT(mFrame->StyleContext() == oldContext,
|
||||
"frame should have been left with its old style context");
|
||||
|
||||
nsIFrame* unused;
|
||||
nsStyleContext* newParent = mFrame->GetParentStyleContext(&unused);
|
||||
if (oldContext->GetParent() != newParent) {
|
||||
// If we received eRestyleResult_Stop, then the old style context was
|
||||
// If we received RestyleResult::eStop, then the old style context was
|
||||
// left on mFrame. Since we ended up restyling our parent, change
|
||||
// this old style context to point to its new parent.
|
||||
LOG_RESTYLE("moving style context %p from old parent %p to new parent %p",
|
||||
|
@ -3363,14 +3363,14 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
return;
|
||||
}
|
||||
|
||||
if (result == eRestyleResult_StopWithStyleChange &&
|
||||
if (result == RestyleResult::eStopWithStyleChange &&
|
||||
!(mHintsHandled & nsChangeHint_ReconstructFrame)) {
|
||||
MOZ_ASSERT(mFrame->StyleContext() != oldContext,
|
||||
"eRestyleResult_StopWithStyleChange should only be returned "
|
||||
"RestyleResult::eStopWithStyleChange should only be returned "
|
||||
"if we got a new style context or we will reconstruct");
|
||||
MOZ_ASSERT(swappedStructs == 0,
|
||||
"should have ensured we didn't swap structs when "
|
||||
"returning eRestyleResult_StopWithStyleChange");
|
||||
"returning RestyleResult::eStopWithStyleChange");
|
||||
|
||||
// We need to ensure that all of the frames that inherit their style
|
||||
// from oldContext are able to be moved across to newContext.
|
||||
|
@ -3397,7 +3397,7 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
|
||||
// Turns out we couldn't stop restyling here. Process the struct
|
||||
// swaps that RestyleSelf would've done had we not returned
|
||||
// eRestyleResult_StopWithStyleChange.
|
||||
// RestyleResult::eStopWithStyleChange.
|
||||
for (SwapInstruction& swap : swaps) {
|
||||
LOG_RESTYLE("swapping style structs between %p and %p",
|
||||
swap.mOldContext.get(), swap.mNewContext.get());
|
||||
|
@ -3414,7 +3414,7 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
oldContext = nullptr;
|
||||
}
|
||||
|
||||
if (result == eRestyleResult_ContinueAndForceDescendants) {
|
||||
if (result == RestyleResult::eContinueAndForceDescendants) {
|
||||
childRestyleHint =
|
||||
nsRestyleHint(childRestyleHint | eRestyle_ForceDescendants);
|
||||
}
|
||||
|
@ -3459,9 +3459,9 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint)
|
|||
* context, we may or may not be able to stop restyling after this frame if
|
||||
* we find we had no style changes.
|
||||
*
|
||||
* This function returns eRestyleResult_Stop if it does not find any
|
||||
* This function returns RestyleResult::eStop if it does not find any
|
||||
* conditions that would preclude stopping restyling, and
|
||||
* eRestyleResult_Continue if it does.
|
||||
* RestyleResult::eContinue if it does.
|
||||
*/
|
||||
void
|
||||
ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
||||
|
@ -3474,7 +3474,7 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
// style contexts.
|
||||
if (aSelf->GetAdditionalStyleContext(0)) {
|
||||
LOG_RESTYLE_CONTINUE("there are additional style contexts");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3488,14 +3488,14 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
|
||||
if (type == nsGkAtoms::letterFrame) {
|
||||
LOG_RESTYLE_CONTINUE("frame is a letter frame");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == nsGkAtoms::lineFrame) {
|
||||
LOG_RESTYLE_CONTINUE("frame is a line frame");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3510,7 +3510,7 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
nsStyleContext* oldContext = aSelf->StyleContext();
|
||||
if (oldContext->HasChildThatUsesGrandancestorStyle()) {
|
||||
LOG_RESTYLE_CONTINUE("the old context uses grandancestor style");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3518,7 +3518,7 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
// We ignore all situations that involve :visited style.
|
||||
if (oldContext->GetStyleIfVisited()) {
|
||||
LOG_RESTYLE_CONTINUE("the old style context has StyleIfVisited");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3526,7 +3526,7 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
nsStyleContext* parentContext = oldContext->GetParent();
|
||||
if (parentContext && parentContext->GetStyleIfVisited()) {
|
||||
LOG_RESTYLE_CONTINUE("the old style context's parent has StyleIfVisited");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3539,7 +3539,7 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
nsIAtom* pseudoTag = oldContext->GetPseudo();
|
||||
if (pseudoTag && !nsCSSAnonBoxes::IsNonElement(pseudoTag)) {
|
||||
LOG_RESTYLE_CONTINUE("the old style context is for a pseudo");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3556,9 +3556,9 @@ ElementRestyler::ComputeRestyleResultFromFrame(nsIFrame* aSelf,
|
|||
MOZ_ASSERT(parentPseudoTag != nsCSSAnonBoxes::mozText,
|
||||
"Style of text node should not be parent of anything");
|
||||
LOG_RESTYLE_CONTINUE("the old style context's parent is for a pseudo");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
// Parent style context pseudo-ness doesn't affect whether we can
|
||||
// return eRestyleResult_StopWithStyleChange.
|
||||
// return RestyleResult::eStopWithStyleChange.
|
||||
//
|
||||
// If we had later conditions to check in this function, we would
|
||||
// continue to check them, in case we set aCanStopWithStyleChange to
|
||||
|
@ -3575,7 +3575,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
{
|
||||
// If we've already determined that we must continue styling, we don't
|
||||
// need to check anything.
|
||||
if (aRestyleResult == eRestyleResult_Continue && !aCanStopWithStyleChange) {
|
||||
if (aRestyleResult == RestyleResult::eContinue && !aCanStopWithStyleChange) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3584,7 +3584,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
// with visited styles.
|
||||
if (aNewContext->GetStyleIfVisited()) {
|
||||
LOG_RESTYLE_CONTINUE("the new style context has StyleIfVisited");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3599,7 +3599,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
oldContext->GetPseudoType() != aNewContext->GetPseudoType()) {
|
||||
LOG_RESTYLE_CONTINUE("the old and new style contexts have different link/"
|
||||
"visited/pseudo");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3607,7 +3607,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
if (oldContext->RuleNode() != aNewContext->RuleNode()) {
|
||||
LOG_RESTYLE_CONTINUE("the old and new style contexts have different "
|
||||
"rulenodes");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
// Continue to check other conditions if aCanStopWithStyleChange might
|
||||
// still need to be set to false.
|
||||
if (!aCanStopWithStyleChange) {
|
||||
|
@ -3623,7 +3623,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
aNewContext->HasTextDecorationLines()) {
|
||||
LOG_RESTYLE_CONTINUE("NS_STYLE_HAS_TEXT_DECORATION_LINES differs between old"
|
||||
" and new style contexts");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3632,7 +3632,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
aNewContext->HasPseudoElementData()) {
|
||||
LOG_RESTYLE_CONTINUE("NS_STYLE_HAS_PSEUDO_ELEMENT_DATA differs between old"
|
||||
" and new style contexts");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3641,7 +3641,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
aNewContext->ShouldSuppressLineBreak()) {
|
||||
LOG_RESTYLE_CONTINUE("NS_STYLE_SUPPRESS_LINEBREAK differs"
|
||||
"between old and new style contexts");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3650,7 +3650,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
aNewContext->IsInDisplayNoneSubtree()) {
|
||||
LOG_RESTYLE_CONTINUE("NS_STYLE_IN_DISPLAY_NONE_SUBTREE differs between old"
|
||||
" and new style contexts");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3658,7 +3658,7 @@ ElementRestyler::ComputeRestyleResultFromNewContext(nsIFrame* aSelf,
|
|||
if (oldContext->IsTextCombined() != aNewContext->IsTextCombined()) {
|
||||
LOG_RESTYLE_CONTINUE("NS_STYLE_IS_TEXT_COMBINED differs between "
|
||||
"old and new style contexts");
|
||||
aRestyleResult = eRestyleResult_Continue;
|
||||
aRestyleResult = RestyleResult::eContinue;
|
||||
aCanStopWithStyleChange = false;
|
||||
return;
|
||||
}
|
||||
|
@ -3810,31 +3810,31 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
// Initially assume that it is safe to stop restyling.
|
||||
//
|
||||
// Throughout most of this function, we update the following two variables
|
||||
// independently. |result| is set to eRestyleResult_Continue when we
|
||||
// detect a condition that would not allow us to return eRestyleResult_Stop.
|
||||
// independently. |result| is set to RestyleResult::eContinue when we
|
||||
// detect a condition that would not allow us to return RestyleResult::eStop.
|
||||
// |canStopWithStyleChange| is set to false when we detect a condition
|
||||
// that would not allow us to return eRestyleResult_StopWithStyleChange.
|
||||
// that would not allow us to return RestyleResult::eStopWithStyleChange.
|
||||
//
|
||||
// Towards the end of this function, we reconcile these two variables --
|
||||
// if |canStopWithStyleChange| is true, we convert |result| into
|
||||
// eRestyleResult_StopWithStyleChange.
|
||||
RestyleResult result = eRestyleResult_Stop;
|
||||
// RestyleResult::eStopWithStyleChange.
|
||||
RestyleResult result = RestyleResult::eStop;
|
||||
bool canStopWithStyleChange = true;
|
||||
|
||||
if (aRestyleHint & ~eRestyle_SomeDescendants) {
|
||||
// If we are doing any restyling of the current element, or if we're
|
||||
// forced to continue, we must.
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
|
||||
// If we have to restyle children, we can't return
|
||||
// eRestyleResult_StopWithStyleChange.
|
||||
// RestyleResult::eStopWithStyleChange.
|
||||
if (aRestyleHint & (eRestyle_Subtree | eRestyle_Force |
|
||||
eRestyle_ForceDescendants)) {
|
||||
canStopWithStyleChange = false;
|
||||
}
|
||||
}
|
||||
|
||||
// We only consider returning eRestyleResult_StopWithStyleChange if this
|
||||
// We only consider returning RestyleResult::eStopWithStyleChange if this
|
||||
// is the root of the restyle. (Otherwise, we would need to track the
|
||||
// style changes of the ancestors we just restyled.)
|
||||
if (!mIsRootOfRestyle) {
|
||||
|
@ -3891,7 +3891,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
mResolvedChild = providerFrame;
|
||||
LOG_RESTYLE_CONTINUE("we had a provider frame");
|
||||
// Continue restyling past the odd style context inheritance.
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
canStopWithStyleChange = false;
|
||||
}
|
||||
|
||||
|
@ -4025,11 +4025,11 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
// style contexts around. However, we need to start from the
|
||||
// same root.
|
||||
LOG_RESTYLE("restyling root and keeping old context");
|
||||
LOG_RESTYLE_IF(this, result != eRestyleResult_Continue,
|
||||
LOG_RESTYLE_IF(this, result != RestyleResult::eContinue,
|
||||
"continuing restyle since this is the root");
|
||||
newContext = oldContext;
|
||||
// Never consider stopping restyling at the root.
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
canStopWithStyleChange = false;
|
||||
}
|
||||
}
|
||||
|
@ -4042,13 +4042,13 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
if (newContext != oldContext) {
|
||||
if (oldContext->IsShared()) {
|
||||
// If the old style context was shared, then we can't return
|
||||
// eRestyleResult_Stop and patch its parent to point to the
|
||||
// RestyleResult::eStop and patch its parent to point to the
|
||||
// new parent style context, as that change might not be valid
|
||||
// for the other frames sharing the style context.
|
||||
LOG_RESTYLE_CONTINUE("the old style context is shared");
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
|
||||
// It is not safe to return eRestyleResult_StopWithStyleChange
|
||||
// It is not safe to return RestyleResult::eStopWithStyleChange
|
||||
// when oldContext is shared and newContext has different
|
||||
// inherited style data, regardless of whether the oldContext has
|
||||
// that inherited style data cached. We can't simply rely on the
|
||||
|
@ -4059,7 +4059,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
// building its display list items). Therefore we must compare
|
||||
// the rule nodes of oldContext and newContext to see if the
|
||||
// restyle results in new inherited style data. If not, then
|
||||
// we can continue assuming that eRestyleResult_StopWithStyleChange
|
||||
// we can continue assuming that RestyleResult::eStopWithStyleChange
|
||||
// is safe. Without this check, we could end up with style contexts
|
||||
// shared between elements which should have different styles.
|
||||
if (!CommonInheritedStyleData(oldContext->RuleNode(),
|
||||
|
@ -4083,7 +4083,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
// RestyleSelf, so until we perform only one restyling per chain-of-
|
||||
// same-style continuations (bug 918064), we need to check again here to
|
||||
// determine whether it is safe to stop restyling.
|
||||
if (result == eRestyleResult_Stop) {
|
||||
if (result == RestyleResult::eStop) {
|
||||
oldContext->CalcStyleDifference(newContext, nsChangeHint(0),
|
||||
&equalStructs,
|
||||
&samePointerStructs);
|
||||
|
@ -4093,7 +4093,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
LOG_RESTYLE_CONTINUE("there is different style data: %s",
|
||||
RestyleManager::StructNamesToString(
|
||||
~equalStructs & NS_STYLE_INHERIT_MASK).get());
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -4102,7 +4102,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
oldContext, &newContext);
|
||||
if (changedStyle) {
|
||||
LOG_RESTYLE_CONTINUE("TryStartingTransition changed the new style context");
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
canStopWithStyleChange = false;
|
||||
}
|
||||
CaptureChange(oldContext, newContext, assumeDifferenceHint,
|
||||
|
@ -4113,7 +4113,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
LOG_RESTYLE_CONTINUE("there is different style data: %s",
|
||||
RestyleManager::StructNamesToString(
|
||||
~equalStructs & NS_STYLE_INHERIT_MASK).get());
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4121,23 +4121,23 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
// If any inherited struct pointers are different, or if any
|
||||
// reset struct pointers are different and we have descendants
|
||||
// that rely on those reset struct pointers, we can't return
|
||||
// eRestyleResult_StopWithStyleChange.
|
||||
// RestyleResult::eStopWithStyleChange.
|
||||
if ((samePointerStructs & NS_STYLE_INHERITED_STRUCT_MASK) !=
|
||||
NS_STYLE_INHERITED_STRUCT_MASK) {
|
||||
LOG_RESTYLE("can't return eRestyleResult_StopWithStyleChange since "
|
||||
LOG_RESTYLE("can't return RestyleResult::eStopWithStyleChange since "
|
||||
"there is different inherited data");
|
||||
canStopWithStyleChange = false;
|
||||
} else if ((samePointerStructs & NS_STYLE_RESET_STRUCT_MASK) !=
|
||||
NS_STYLE_RESET_STRUCT_MASK &&
|
||||
oldContext->HasChildThatUsesResetStyle()) {
|
||||
LOG_RESTYLE("can't return eRestyleResult_StopWithStyleChange since "
|
||||
LOG_RESTYLE("can't return RestyleResult::eStopWithStyleChange since "
|
||||
"there is different reset data and descendants use it");
|
||||
canStopWithStyleChange = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (result == eRestyleResult_Stop) {
|
||||
// Since we currently have eRestyleResult_Stop, we know at this
|
||||
if (result == RestyleResult::eStop) {
|
||||
// Since we currently have RestyleResult::eStop, we know at this
|
||||
// point that all of our style structs are equal in terms of styles.
|
||||
// However, some of them might be different pointers. Since our
|
||||
// descendants might share those pointers, we have to continue to
|
||||
|
@ -4164,25 +4164,25 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
if (oldContext->HasCachedDependentStyleData(sid) &&
|
||||
!(samePointerStructs & nsCachedStyleData::GetBitForSID(sid))) {
|
||||
LOG_RESTYLE_CONTINUE("there are different struct pointers");
|
||||
result = eRestyleResult_Continue;
|
||||
result = RestyleResult::eContinue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// From this point we no longer do any assignments of
|
||||
// eRestyleResult_Continue to |result|. If canStopWithStyleChange is true,
|
||||
// RestyleResult::eContinue to |result|. If canStopWithStyleChange is true,
|
||||
// it means that we can convert |result| (whether it is
|
||||
// eRestyleResult_Continue or eRestyleResult_Stop) into
|
||||
// eRestyleResult_StopWithStyleChange.
|
||||
// RestyleResult::eContinue or RestyleResult::eStop) into
|
||||
// RestyleResult::eStopWithStyleChange.
|
||||
if (canStopWithStyleChange) {
|
||||
LOG_RESTYLE("converting %s into eRestyleResult_StopWithStyleChange",
|
||||
LOG_RESTYLE("converting %s into RestyleResult::eStopWithStyleChange",
|
||||
RestyleResultToString(result).get());
|
||||
result = eRestyleResult_StopWithStyleChange;
|
||||
result = RestyleResult::eStopWithStyleChange;
|
||||
}
|
||||
|
||||
if (aRestyleHint & eRestyle_ForceDescendants) {
|
||||
result = eRestyleResult_ContinueAndForceDescendants;
|
||||
result = RestyleResult::eContinueAndForceDescendants;
|
||||
}
|
||||
|
||||
if (!(mHintsHandled & nsChangeHint_ReconstructFrame)) {
|
||||
|
@ -4194,7 +4194,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
// since we'll have copied the existing context from the
|
||||
// previous continuation, so newContext == oldContext.
|
||||
|
||||
if (result != eRestyleResult_Stop) {
|
||||
if (result != RestyleResult::eStop) {
|
||||
if (copyFromContinuation) {
|
||||
LOG_RESTYLE("not swapping style structs, since we copied from a "
|
||||
"continuation");
|
||||
|
@ -4208,9 +4208,9 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
LOG_RESTYLE("not swapping style structs, since the new context is "
|
||||
"shared");
|
||||
} else {
|
||||
if (result == eRestyleResult_StopWithStyleChange) {
|
||||
if (result == RestyleResult::eStopWithStyleChange) {
|
||||
LOG_RESTYLE("recording a style struct swap between %p and %p to "
|
||||
"do if eRestyleResult_StopWithStyleChange fails",
|
||||
"do if RestyleResult::eStopWithStyleChange fails",
|
||||
oldContext.get(), newContext.get());
|
||||
SwapInstruction* swap = aSwaps.AppendElement();
|
||||
swap->mOldContext = oldContext;
|
||||
|
@ -4250,7 +4250,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf,
|
|||
}
|
||||
} else {
|
||||
if (aRestyleHint & eRestyle_ForceDescendants) {
|
||||
result = eRestyleResult_ContinueAndForceDescendants;
|
||||
result = RestyleResult::eContinueAndForceDescendants;
|
||||
}
|
||||
}
|
||||
oldContext = nullptr;
|
||||
|
@ -4502,7 +4502,7 @@ ElementRestyler::ComputeStyleChangeFor(nsIFrame* aFrame,
|
|||
|
||||
if (nextIBSibling) {
|
||||
// Don't allow some ib-split siblings to be processed with
|
||||
// eRestyleResult_StopWithStyleChange and others not.
|
||||
// RestyleResult::eStopWithStyleChange and others not.
|
||||
aRestyleHint |= eRestyle_Force;
|
||||
}
|
||||
|
||||
|
@ -5181,20 +5181,21 @@ ElementRestyler::RestyleResultToString(RestyleResult aRestyleResult)
|
|||
{
|
||||
nsCString result;
|
||||
switch (aRestyleResult) {
|
||||
case eRestyleResult_Stop:
|
||||
result.AssignLiteral("eRestyleResult_Stop");
|
||||
case RestyleResult::eStop:
|
||||
result.AssignLiteral("RestyleResult::eStop");
|
||||
break;
|
||||
case eRestyleResult_StopWithStyleChange:
|
||||
result.AssignLiteral("eRestyleResult_StopWithStyleChange");
|
||||
case RestyleResult::eStopWithStyleChange:
|
||||
result.AssignLiteral("RestyleResult::eStopWithStyleChange");
|
||||
break;
|
||||
case eRestyleResult_Continue:
|
||||
result.AssignLiteral("eRestyleResult_Continue");
|
||||
case RestyleResult::eContinue:
|
||||
result.AssignLiteral("RestyleResult::eContinue");
|
||||
break;
|
||||
case eRestyleResult_ContinueAndForceDescendants:
|
||||
result.AssignLiteral("eRestyleResult_ContinueAndForceDescendants");
|
||||
case RestyleResult::eContinueAndForceDescendants:
|
||||
result.AssignLiteral("RestyleResult::eContinueAndForceDescendants");
|
||||
break;
|
||||
default:
|
||||
result.AppendPrintf("RestyleResult(%d)", aRestyleResult);
|
||||
MOZ_ASSERT(aRestyleResult == RestyleResult::eNone,
|
||||
"Unexpected RestyleResult");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -665,25 +665,27 @@ public:
|
|||
private:
|
||||
inline nsStyleSet* StyleSet() const;
|
||||
|
||||
// Enum for the result of RestyleSelf, which indicates whether the
|
||||
// Enum class for the result of RestyleSelf, which indicates whether the
|
||||
// restyle procedure should continue to the children, and how.
|
||||
//
|
||||
// These values must be ordered so that later values imply that all
|
||||
// the work of the earlier values is also done.
|
||||
enum RestyleResult {
|
||||
enum class RestyleResult : uint8_t {
|
||||
// default initial value
|
||||
eNone,
|
||||
|
||||
// we left the old style context on the frame; do not restyle children
|
||||
eRestyleResult_Stop = 1,
|
||||
eStop,
|
||||
|
||||
// we got a new style context on this frame, but we know that children
|
||||
// do not depend on the changed values; do not restyle children
|
||||
eRestyleResult_StopWithStyleChange,
|
||||
eStopWithStyleChange,
|
||||
|
||||
// continue restyling children
|
||||
eRestyleResult_Continue,
|
||||
eContinue,
|
||||
|
||||
// continue restyling children with eRestyle_ForceDescendants set
|
||||
eRestyleResult_ContinueAndForceDescendants
|
||||
eContinueAndForceDescendants
|
||||
};
|
||||
|
||||
struct SwapInstruction
|
||||
|
|
|
@ -449,7 +449,7 @@ RestyleTracker::AddRestyleRootsIfAwaitingRestyle(
|
|||
// The RestyleData for a given element has stored in mDescendants
|
||||
// the list of descendants we need to end up restyling. Since we
|
||||
// won't necessarily end up restyling them, due to the restyle
|
||||
// process finishing early (see how eRestyleResult_Stop is handled
|
||||
// process finishing early (see how RestyleResult::eStop is handled
|
||||
// in ElementRestyler::Restyle), we add them to the list of restyle
|
||||
// roots to handle the next time around the
|
||||
// RestyleTracker::DoProcessRestyles loop.
|
||||
|
|
|
@ -347,7 +347,7 @@ public:
|
|||
* that we did not add as restyle roots initially (due to there being
|
||||
* an ancestor with the restyle root bit set), but which we might
|
||||
* not have got around to restyling due to the restyle process
|
||||
* terminating early with eRestyleResult_Stop (see ElementRestyler::Restyle).
|
||||
* terminating early with RestyleResul::eStop (see ElementRestyler::Restyle).
|
||||
*
|
||||
* This function must be called with elements in order such that
|
||||
* appending them to mRestyleRoots maintains its ordering invariant that
|
||||
|
|
|
@ -978,8 +978,10 @@ nsHTMLFramesetFrame::Reflow(nsPresContext* aPresContext,
|
|||
childVis = (eFrameborder_No == frameborder) ? NONE_VIS : ALL_VIS;
|
||||
}
|
||||
} else { // blank
|
||||
DebugOnly<nsHTMLFramesetBlankFrame*> blank;
|
||||
MOZ_ASSERT(blank = do_QueryFrame(child), "unexpected child frame type");
|
||||
#ifdef DEBUG
|
||||
nsHTMLFramesetBlankFrame* blank = do_QueryFrame(child);
|
||||
MOZ_ASSERT(blank, "unexpected child frame type");
|
||||
#endif
|
||||
childVis = NONE_VIS;
|
||||
}
|
||||
nsBorderColor childColors = mChildBorderColors[childX];
|
||||
|
|
|
@ -4802,8 +4802,16 @@ nsDisplayText::Paint(nsDisplayListBuilder* aBuilder,
|
|||
nsTextFrame::PaintTextParams params(aCtx->ThebesContext());
|
||||
params.framePt = gfxPoint(framePt.x, framePt.y);
|
||||
params.dirtyRect = extraVisible;
|
||||
params.generateTextMask = aBuilder->IsForGenerateGlyphMask();
|
||||
params.paintSelectionBackground = aBuilder->IsForPaintingSelectionBG();
|
||||
|
||||
if (aBuilder->IsForGenerateGlyphMask()) {
|
||||
MOZ_ASSERT(!aBuilder->IsForPaintingSelectionBG());
|
||||
params.state = nsTextFrame::PaintTextParams::GenerateTextMask;
|
||||
} else if (aBuilder->IsForPaintingSelectionBG()) {
|
||||
params.state = nsTextFrame::PaintTextParams::PaintTextBGColor;
|
||||
} else {
|
||||
params.state = nsTextFrame::PaintTextParams::PaintText;
|
||||
}
|
||||
|
||||
f->PaintText(params, *this, mOpacity);
|
||||
}
|
||||
|
||||
|
@ -6003,8 +6011,7 @@ nsTextFrame::PaintTextWithSelectionColors(
|
|||
Range range; // in transformed string
|
||||
TextRangeStyle rangeStyle;
|
||||
// Draw background colors
|
||||
if (anyBackgrounds && (!aParams.generateTextMask ||
|
||||
aParams.paintSelectionBackground)) {
|
||||
if (anyBackgrounds && !aParams.IsGenerateTextMask()) {
|
||||
int32_t appUnitsPerDevPixel =
|
||||
aParams.textPaintStyle->PresContext()->AppUnitsPerDevPixel();
|
||||
SelectionIterator iterator(prevailingSelections, contentRange,
|
||||
|
@ -6037,7 +6044,7 @@ nsTextFrame::PaintTextWithSelectionColors(
|
|||
}
|
||||
}
|
||||
|
||||
if (aParams.paintSelectionBackground) {
|
||||
if (aParams.IsPaintBGColor()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -6063,7 +6070,7 @@ nsTextFrame::PaintTextWithSelectionColors(
|
|||
while (iterator.GetNextSegment(&iOffset, &range, &hyphenWidth,
|
||||
&selectionType, &rangeStyle)) {
|
||||
nscolor foreground, background;
|
||||
if (aParams.generateTextMask) {
|
||||
if (aParams.IsGenerateTextMask()) {
|
||||
foreground = NS_RGBA(0, 0, 0, 255);
|
||||
} else {
|
||||
GetSelectionTextColors(selectionType, *aParams.textPaintStyle,
|
||||
|
@ -6596,8 +6603,7 @@ nsTextFrame::PaintText(const PaintTextParams& aParams,
|
|||
|
||||
// Fork off to the (slower) paint-with-selection path if necessary.
|
||||
if (aItem.mIsFrameSelected.value() &&
|
||||
(aParams.paintSelectionBackground ||
|
||||
ShouldDrawSelection(this->GetParent()))) {
|
||||
(aParams.IsPaintBGColor() || ShouldDrawSelection(this->GetParent()))) {
|
||||
MOZ_ASSERT(aOpacity == 1.0f, "We don't support opacity with selections!");
|
||||
gfxSkipCharsIterator tmp(provider.GetStart());
|
||||
Range contentRange(
|
||||
|
@ -6613,11 +6619,11 @@ nsTextFrame::PaintText(const PaintTextParams& aParams,
|
|||
}
|
||||
}
|
||||
|
||||
if (aParams.paintSelectionBackground) {
|
||||
if (aParams.IsPaintBGColor()) {
|
||||
return;
|
||||
}
|
||||
|
||||
nscolor foregroundColor = aParams.generateTextMask
|
||||
nscolor foregroundColor = aParams.IsGenerateTextMask()
|
||||
? NS_RGBA(0, 0, 0, 255)
|
||||
: textPaintStyle.GetTextColor();
|
||||
if (aOpacity != 1.0f) {
|
||||
|
@ -6626,7 +6632,7 @@ nsTextFrame::PaintText(const PaintTextParams& aParams,
|
|||
foregroundColor = gfxColor.ToABGR();
|
||||
}
|
||||
|
||||
nscolor textStrokeColor = aParams.generateTextMask
|
||||
nscolor textStrokeColor = aParams.IsGenerateTextMask()
|
||||
? NS_RGBA(0, 0, 0, 255)
|
||||
: textPaintStyle.GetWebkitTextStrokeColor();
|
||||
if (aOpacity != 1.0f) {
|
||||
|
@ -6636,7 +6642,7 @@ nsTextFrame::PaintText(const PaintTextParams& aParams,
|
|||
}
|
||||
|
||||
range = Range(startOffset, startOffset + maxLength);
|
||||
if (!aParams.callbacks) {
|
||||
if (!aParams.callbacks && aParams.IsPaintText()) {
|
||||
const nsStyleText* textStyle = StyleText();
|
||||
PaintShadowParams shadowParams(aParams);
|
||||
shadowParams.range = range;
|
||||
|
|
|
@ -395,9 +395,21 @@ public:
|
|||
LayoutDeviceRect dirtyRect;
|
||||
gfxTextContextPaint* contextPaint = nullptr;
|
||||
DrawPathCallbacks* callbacks = nullptr;
|
||||
bool generateTextMask = false;
|
||||
bool paintSelectionBackground = false;
|
||||
enum {
|
||||
PaintText, // Normal text painting.
|
||||
PaintTextBGColor, // Only paint background color of the selected text
|
||||
// range in this state.
|
||||
GenerateTextMask // To generate a mask from a text frame. Should
|
||||
// only paint text itself with opaque color.
|
||||
// Text shadow, text selection color and text
|
||||
// decoration are all discarded in this state.
|
||||
};
|
||||
uint8_t state = PaintText;
|
||||
explicit PaintTextParams(gfxContext* aContext) : context(aContext) {}
|
||||
|
||||
bool IsPaintText() const { return state == PaintText; }
|
||||
bool IsGenerateTextMask() const { return state == GenerateTextMask; }
|
||||
bool IsPaintBGColor() const { return state == PaintTextBGColor; }
|
||||
};
|
||||
|
||||
struct PaintTextSelectionParams : PaintTextParams
|
||||
|
|
|
@ -57,7 +57,10 @@ PrintTranslator::TranslateRecording(std::istream& aRecording)
|
|||
return false;
|
||||
}
|
||||
|
||||
recordedEvent->PlayEvent(this);
|
||||
if (!recordedEvent->PlayEvent(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ReadElement(aRecording, eventType);
|
||||
}
|
||||
|
||||
|
@ -99,4 +102,4 @@ PrintTranslator::GetDesiredFontType()
|
|||
}
|
||||
|
||||
} // namespace layout
|
||||
} // namespace mozilla
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -112,7 +112,9 @@ RemotePrintJobParent::PrintPage(const Shmem& aStoredPage)
|
|||
|
||||
std::istringstream recording(std::string(aStoredPage.get<char>(),
|
||||
aStoredPage.Size<char>()));
|
||||
mPrintTranslator->TranslateRecording(recording);
|
||||
if (!mPrintTranslator->TranslateRecording(recording)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
rv = mPrintDeviceContext->EndPage();
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>background-clip: text reference</title>
|
||||
<style>
|
||||
div.out {
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
margin: 0px;
|
||||
color: white;
|
||||
font-size: 50px;
|
||||
font-family: serif;
|
||||
text-shadow: 0px 60px 5px red;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin: 0px;">
|
||||
<div class="out">
|
||||
Text Shadow
|
||||
<div style="display:inline-block; width:0px; height:100px;"/>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,28 @@
|
|||
<!doctype HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>background-clip: text shadow</title>
|
||||
<style>
|
||||
div.out {
|
||||
width: 500px;
|
||||
height: 300px;
|
||||
margin: 0px;
|
||||
background-image: linear-gradient(green, green);
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
font-size: 50px;
|
||||
font-family: serif;
|
||||
text-shadow: 0px 60px 5px red;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="margin: 0px;">
|
||||
<div class="out">
|
||||
Text Shadow
|
||||
<div style="display:inline-block; width:0px; height:100px;"/>
|
||||
</div>
|
||||
<!-- A white div which is used to cover on text -->
|
||||
<div style="position: absolute; top: 0px; left:0px; width:500px; height:110px;background-color:white;"/>
|
||||
</body>
|
||||
</html>
|
|
@ -185,3 +185,5 @@ pref(layout.css.background-clip-text.enabled,true) fuzzy-if(winWidget,102,2032)
|
|||
pref(layout.css.background-clip-text.enabled,true) fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2595) == background-clip-text-1d.html background-clip-text-1-ref.html
|
||||
pref(layout.css.background-clip-text.enabled,true) fuzzy-if(winWidget,102,2032) fuzzy-if(skiaContent,102,2595) == background-clip-text-1e.html background-clip-text-1-ref.html
|
||||
pref(layout.css.background-clip-text.enabled,false) != background-clip-text-1a.html background-clip-text-1-ref.html
|
||||
|
||||
pref(layout.css.background-clip-text.enabled,true) == background-clip-text-2.html background-clip-text-2-ref.html
|
||||
|
|
|
@ -77,7 +77,7 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
|
|||
@Override
|
||||
public int onStartCommand(Intent intent, int flags, int startId) {
|
||||
handleIntent(intent);
|
||||
return super.onStartCommand(intent, flags, startId);
|
||||
return START_NOT_STICKY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -267,6 +267,7 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
|
|||
final Notification.MediaStyle style = new Notification.MediaStyle();
|
||||
style.setShowActionsInCompactView(0);
|
||||
|
||||
final boolean isMediaPlaying = action.equals(ACTION_PAUSE);
|
||||
final Notification notification = new Notification.Builder(this)
|
||||
.setSmallIcon(R.drawable.flat_icon)
|
||||
.setLargeIcon(generateCoverArt(tab))
|
||||
|
@ -276,13 +277,18 @@ public class MediaControlService extends Service implements Tabs.OnTabsChangedLi
|
|||
.setDeleteIntent(createDeleteIntent())
|
||||
.setStyle(style)
|
||||
.addAction(createNotificationAction(action))
|
||||
.setOngoing(action.equals(ACTION_PAUSE))
|
||||
.setOngoing(isMediaPlaying)
|
||||
.setShowWhen(false)
|
||||
.setWhen(0)
|
||||
.build();
|
||||
|
||||
NotificationManagerCompat.from(this)
|
||||
if (isMediaPlaying) {
|
||||
startForeground(MEDIA_CONTROL_ID, notification);
|
||||
} else {
|
||||
stopForeground(false);
|
||||
NotificationManagerCompat.from(this)
|
||||
.notify(MEDIA_CONTROL_ID, notification);
|
||||
}
|
||||
}
|
||||
|
||||
private Notification.Action createNotificationAction(String action) {
|
||||
|
|
|
@ -287,6 +287,10 @@ nsAndroidHistory::SetURITitle(nsIURI *aURI, const nsAString& aTitle)
|
|||
nsAutoCString uri;
|
||||
nsresult rv = aURI->GetSpec(uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (RemovePendingVisitURI(aURI)) {
|
||||
// We have a title, so aURI isn't a redirect, so save the visit now before setting the title.
|
||||
SaveVisitURI(aURI);
|
||||
}
|
||||
NS_ConvertUTF8toUTF16 uriString(uri);
|
||||
widget::GeckoAppShell::SetURITitle(uriString, aTitle);
|
||||
}
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -106,7 +106,7 @@ class VCFiles(object):
|
|||
return subprocess.check_output(cmd).split()
|
||||
|
||||
|
||||
def find_linters(self, linters=None):
|
||||
def find_linters(linters=None):
|
||||
lints = []
|
||||
for search_path in SEARCH_PATHS:
|
||||
if not os.path.isdir(search_path):
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
Copyright (c) 2010, Alec Thomas
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
- Neither the name of SwapOff.org nor the names of its contributors may
|
||||
be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -0,0 +1,2 @@
|
|||
include *.md
|
||||
include COPYING
|
|
@ -0,0 +1,611 @@
|
|||
Metadata-Version: 1.1
|
||||
Name: voluptuous
|
||||
Version: 0.8.11
|
||||
Summary: Voluptuous is a Python data validation library
|
||||
Home-page: https://github.com/alecthomas/voluptuous
|
||||
Author: Alec Thomas
|
||||
Author-email: alec@swapoff.org
|
||||
License: BSD
|
||||
Download-URL: https://pypi.python.org/pypi/voluptuous
|
||||
Description: Voluptuous is a Python data validation library
|
||||
==============================================
|
||||
|
||||
|Build Status| |Stories in Ready|
|
||||
|
||||
Voluptuous, *despite* the name, is a Python data validation library. It
|
||||
is primarily intended for validating data coming into Python as JSON,
|
||||
YAML, etc.
|
||||
|
||||
It has three goals:
|
||||
|
||||
1. Simplicity.
|
||||
2. Support for complex data structures.
|
||||
3. Provide useful error messages.
|
||||
|
||||
Contact
|
||||
-------
|
||||
|
||||
Voluptuous now has a mailing list! Send a mail to
|
||||
` <mailto:voluptuous@librelist.com>`__ to subscribe. Instructions will
|
||||
follow.
|
||||
|
||||
You can also contact me directly via `email <mailto:alec@swapoff.org>`__
|
||||
or `Twitter <https://twitter.com/alecthomas>`__.
|
||||
|
||||
To file a bug, create a `new
|
||||
issue <https://github.com/alecthomas/voluptuous/issues/new>`__ on GitHub
|
||||
with a short example of how to replicate the issue.
|
||||
|
||||
Show me an example
|
||||
------------------
|
||||
|
||||
Twitter's `user search
|
||||
API <https://dev.twitter.com/docs/api/1/get/users/search>`__ accepts
|
||||
query URLs like:
|
||||
|
||||
::
|
||||
|
||||
$ curl 'http://api.twitter.com/1/users/search.json?q=python&per_page=20&page=1
|
||||
|
||||
To validate this we might use a schema like:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Schema
|
||||
>>> schema = Schema({
|
||||
... 'q': str,
|
||||
... 'per_page': int,
|
||||
... 'page': int,
|
||||
... })
|
||||
|
||||
This schema very succinctly and roughly describes the data required by
|
||||
the API, and will work fine. But it has a few problems. Firstly, it
|
||||
doesn't fully express the constraints of the API. According to the API,
|
||||
``per_page`` should be restricted to at most 20, defaulting to 5, for
|
||||
example. To describe the semantics of the API more accurately, our
|
||||
schema will need to be more thoroughly defined:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Required, All, Length, Range
|
||||
>>> schema = Schema({
|
||||
... Required('q'): All(str, Length(min=1)),
|
||||
... Required('per_page', default=5): All(int, Range(min=1, max=20)),
|
||||
... 'page': All(int, Range(min=0)),
|
||||
... })
|
||||
|
||||
This schema fully enforces the interface defined in Twitter's
|
||||
documentation, and goes a little further for completeness.
|
||||
|
||||
"q" is required:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import MultipleInvalid, Invalid
|
||||
>>> try:
|
||||
... schema({})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data['q']"
|
||||
True
|
||||
|
||||
...must be a string:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': 123})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected str for dictionary value @ data['q']"
|
||||
True
|
||||
|
||||
...and must be at least one character in length:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': ''})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "length of value must be at least 1 for dictionary value @ data['q']"
|
||||
True
|
||||
>>> schema({'q': '#topic'}) == {'q': '#topic', 'per_page': 5}
|
||||
True
|
||||
|
||||
"per\_page" is a positive integer no greater than 20:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': 900})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "value must be at most 20 for dictionary value @ data['per_page']"
|
||||
True
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': -10})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "value must be at least 1 for dictionary value @ data['per_page']"
|
||||
True
|
||||
|
||||
"page" is an integer >= 0:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': 'one'})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"expected int for dictionary value @ data['per_page']"
|
||||
>>> schema({'q': '#topic', 'page': 1}) == {'q': '#topic', 'page': 1, 'per_page': 5}
|
||||
True
|
||||
|
||||
Defining schemas
|
||||
----------------
|
||||
|
||||
Schemas are nested data structures consisting of dictionaries, lists,
|
||||
scalars and *validators*. Each node in the input schema is pattern
|
||||
matched against corresponding nodes in the input data.
|
||||
|
||||
Literals
|
||||
~~~~~~~~
|
||||
|
||||
Literals in the schema are matched using normal equality checks:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema(1)
|
||||
>>> schema(1)
|
||||
1
|
||||
>>> schema = Schema('a string')
|
||||
>>> schema('a string')
|
||||
'a string'
|
||||
|
||||
Types
|
||||
~~~~~
|
||||
|
||||
Types in the schema are matched by checking if the corresponding value
|
||||
is an instance of the type:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema(int)
|
||||
>>> schema(1)
|
||||
1
|
||||
>>> try:
|
||||
... schema('one')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected int"
|
||||
True
|
||||
|
||||
URL's
|
||||
~~~~~
|
||||
|
||||
URL's in the schema are matched by using ``urlparse`` library.
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Url
|
||||
>>> schema = Schema(Url())
|
||||
>>> schema('http://w3.org')
|
||||
'http://w3.org'
|
||||
>>> try:
|
||||
... schema('one')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected a URL"
|
||||
True
|
||||
|
||||
Lists
|
||||
~~~~~
|
||||
|
||||
Lists in the schema are treated as a set of valid values. Each element
|
||||
in the schema list is compared to each value in the input data:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema([1, 'a', 'string'])
|
||||
>>> schema([1])
|
||||
[1]
|
||||
>>> schema([1, 1, 1])
|
||||
[1, 1, 1]
|
||||
>>> schema(['a', 1, 'string', 1, 'string'])
|
||||
['a', 1, 'string', 1, 'string']
|
||||
|
||||
Validation functions
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Validators are simple callables that raise an ``Invalid`` exception when
|
||||
they encounter invalid data. The criteria for determining validity is
|
||||
entirely up to the implementation; it may check that a value is a valid
|
||||
username with ``pwd.getpwnam()``, it may check that a value is of a
|
||||
specific type, and so on.
|
||||
|
||||
The simplest kind of validator is a Python function that raises
|
||||
ValueError when its argument is invalid. Conveniently, many builtin
|
||||
Python functions have this property. Here's an example of a date
|
||||
validator:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from datetime import datetime
|
||||
>>> def Date(fmt='%Y-%m-%d'):
|
||||
... return lambda v: datetime.strptime(v, fmt)
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema(Date())
|
||||
>>> schema('2013-03-03')
|
||||
datetime.datetime(2013, 3, 3, 0, 0)
|
||||
>>> try:
|
||||
... schema('2013-03')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "not a valid value"
|
||||
True
|
||||
|
||||
In addition to simply determining if a value is valid, validators may
|
||||
mutate the value into a valid form. An example of this is the
|
||||
``Coerce(type)`` function, which returns a function that coerces its
|
||||
argument to the given type:
|
||||
|
||||
.. code:: python
|
||||
|
||||
def Coerce(type, msg=None):
|
||||
"""Coerce a value to a type.
|
||||
|
||||
If the type constructor throws a ValueError, the value will be marked as
|
||||
Invalid.
|
||||
"""
|
||||
def f(v):
|
||||
try:
|
||||
return type(v)
|
||||
except ValueError:
|
||||
raise Invalid(msg or ('expected %s' % type.__name__))
|
||||
return f
|
||||
|
||||
This example also shows a common idiom where an optional human-readable
|
||||
message can be provided. This can vastly improve the usefulness of the
|
||||
resulting error messages.
|
||||
|
||||
Dictionaries
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Each key-value pair in a schema dictionary is validated against each
|
||||
key-value pair in the corresponding data dictionary:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({1: 'one', 2: 'two'})
|
||||
>>> schema({1: 'one'})
|
||||
{1: 'one'}
|
||||
|
||||
Extra dictionary keys
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By default any additional keys in the data, not in the schema will
|
||||
trigger exceptions:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({2: 3})
|
||||
>>> try:
|
||||
... schema({1: 2, 2: 3})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "extra keys not allowed @ data[1]"
|
||||
True
|
||||
|
||||
This behaviour can be altered on a per-schema basis. To allow additional
|
||||
keys use ``Schema(..., extra=ALLOW_EXTRA)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import ALLOW_EXTRA
|
||||
>>> schema = Schema({2: 3}, extra=ALLOW_EXTRA)
|
||||
>>> schema({1: 2, 2: 3})
|
||||
{1: 2, 2: 3}
|
||||
|
||||
To remove additional keys use ``Schema(..., extra=REMOVE_EXTRA)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import REMOVE_EXTRA
|
||||
>>> schema = Schema({2: 3}, extra=REMOVE_EXTRA)
|
||||
>>> schema({1: 2, 2: 3})
|
||||
{2: 3}
|
||||
|
||||
It can also be overridden per-dictionary by using the catch-all marker
|
||||
token ``extra`` as a key:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Extra
|
||||
>>> schema = Schema({1: {Extra: object}})
|
||||
>>> schema({1: {'foo': 'bar'}})
|
||||
{1: {'foo': 'bar'}}
|
||||
|
||||
Required dictionary keys
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By default, keys in the schema are not required to be in the data:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({1: 2, 3: 4})
|
||||
>>> schema({3: 4})
|
||||
{3: 4}
|
||||
|
||||
Similarly to how extra\_ keys work, this behaviour can be overridden
|
||||
per-schema:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({1: 2, 3: 4}, required=True)
|
||||
>>> try:
|
||||
... schema({3: 4})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
|
||||
And per-key, with the marker token ``Required(key)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({Required(1): 2, 3: 4})
|
||||
>>> try:
|
||||
... schema({3: 4})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
>>> schema({1: 2})
|
||||
{1: 2}
|
||||
|
||||
Optional dictionary keys
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If a schema has ``required=True``, keys may be individually marked as
|
||||
optional using the marker token ``Optional(key)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Optional
|
||||
>>> schema = Schema({1: 2, Optional(3): 4}, required=True)
|
||||
>>> try:
|
||||
... schema({})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
>>> schema({1: 2})
|
||||
{1: 2}
|
||||
>>> try:
|
||||
... schema({1: 2, 4: 5})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "extra keys not allowed @ data[4]"
|
||||
True
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema({1: 2, 3: 4})
|
||||
{1: 2, 3: 4}
|
||||
|
||||
Recursive schema
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
There is no syntax to have a recursive schema. The best way to do it is
|
||||
to have a wrapper like this:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Schema, Any
|
||||
>>> def s2(v):
|
||||
... return s1(v)
|
||||
...
|
||||
>>> s1 = Schema({"key": Any(s2, "value")})
|
||||
>>> s1({"key": {"key": "value"}})
|
||||
{'key': {'key': 'value'}}
|
||||
|
||||
Extending an existing Schema
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Often it comes handy to have a base ``Schema`` that is extended with
|
||||
more requirements. In that case you can use ``Schema.extend`` to create
|
||||
a new ``Schema``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Schema
|
||||
>>> person = Schema({'name': str})
|
||||
>>> person_with_age = person.extend({'age': int})
|
||||
>>> sorted(list(person_with_age.schema.keys()))
|
||||
['age', 'name']
|
||||
|
||||
The original ``Schema`` remains unchanged.
|
||||
|
||||
Objects
|
||||
~~~~~~~
|
||||
|
||||
Each key-value pair in a schema dictionary is validated against each
|
||||
attribute-value pair in the corresponding object:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Object
|
||||
>>> class Structure(object):
|
||||
... def __init__(self, q=None):
|
||||
... self.q = q
|
||||
... def __repr__(self):
|
||||
... return '<Structure(q={0.q!r})>'.format(self)
|
||||
...
|
||||
>>> schema = Schema(Object({'q': 'one'}, cls=Structure))
|
||||
>>> schema(Structure(q='one'))
|
||||
<Structure(q='one')>
|
||||
|
||||
Allow None values
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
To allow value to be None as well, use Any:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Any
|
||||
|
||||
>>> schema = Schema(Any(None, int))
|
||||
>>> schema(None)
|
||||
>>> schema(5)
|
||||
5
|
||||
|
||||
Error reporting
|
||||
---------------
|
||||
|
||||
Validators must throw an ``Invalid`` exception if invalid data is passed
|
||||
to them. All other exceptions are treated as errors in the validator and
|
||||
will not be caught.
|
||||
|
||||
Each ``Invalid`` exception has an associated ``path`` attribute
|
||||
representing the path in the data structure to our currently validating
|
||||
value, as well as an ``error_message`` attribute that contains the
|
||||
message of the original exception. This is especially useful when you
|
||||
want to catch ``Invalid`` exceptions and give some feedback to the user,
|
||||
for instance in the context of an HTTP API.
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> def validate_email(email):
|
||||
... """Validate email."""
|
||||
... if not "@" in email:
|
||||
... raise Invalid("This email is invalid.")
|
||||
... return email
|
||||
>>> schema = Schema({"email": validate_email})
|
||||
>>> exc = None
|
||||
>>> try:
|
||||
... schema({"email": "whatever"})
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"This email is invalid. for dictionary value @ data['email']"
|
||||
>>> exc.path
|
||||
['email']
|
||||
>>> exc.msg
|
||||
'This email is invalid.'
|
||||
>>> exc.error_message
|
||||
'This email is invalid.'
|
||||
|
||||
The ``path`` attribute is used during error reporting, but also during
|
||||
matching to determine whether an error should be reported to the user or
|
||||
if the next match should be attempted. This is determined by comparing
|
||||
the depth of the path where the check is, to the depth of the path where
|
||||
the error occurred. If the error is more than one level deeper, it is
|
||||
reported.
|
||||
|
||||
The upshot of this is that *matching is depth-first and fail-fast*.
|
||||
|
||||
To illustrate this, here is an example schema:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema([[2, 3], 6])
|
||||
|
||||
Each value in the top-level list is matched depth-first in-order. Given
|
||||
input data of ``[[6]]``, the inner list will match the first element of
|
||||
the schema, but the literal ``6`` will not match any of the elements of
|
||||
that list. This error will be reported back to the user immediately. No
|
||||
backtracking is attempted:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema([[6]])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "not a valid value @ data[0][0]"
|
||||
True
|
||||
|
||||
If we pass the data ``[6]``, the ``6`` is not a list type and so will
|
||||
not recurse into the first element of the schema. Matching will continue
|
||||
on to the second element in the schema, and succeed:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema([6])
|
||||
[6]
|
||||
|
||||
Running tests.
|
||||
--------------
|
||||
|
||||
Voluptuous is using nosetests:
|
||||
|
||||
::
|
||||
|
||||
$ nosetests
|
||||
|
||||
Why use Voluptuous over another validation library?
|
||||
---------------------------------------------------
|
||||
|
||||
**Validators are simple callables**
|
||||
No need to subclass anything, just use a function.
|
||||
**Errors are simple exceptions.**
|
||||
A validator can just ``raise Invalid(msg)`` and expect the user to
|
||||
get useful messages.
|
||||
**Schemas are basic Python data structures.**
|
||||
Should your data be a dictionary of integer keys to strings?
|
||||
``{int: str}`` does what you expect. List of integers, floats or
|
||||
strings? ``[int, float, str]``.
|
||||
**Designed from the ground up for validating more than just forms.**
|
||||
Nested data structures are treated in the same way as any other
|
||||
type. Need a list of dictionaries? ``[{}]``
|
||||
**Consistency.**
|
||||
Types in the schema are checked as types. Values are compared as
|
||||
values. Callables are called to validate. Simple.
|
||||
|
||||
Other libraries and inspirations
|
||||
--------------------------------
|
||||
|
||||
Voluptuous is heavily inspired by
|
||||
`Validino <http://code.google.com/p/validino/>`__, and to a lesser
|
||||
extent, `jsonvalidator <http://code.google.com/p/jsonvalidator/>`__ and
|
||||
`json\_schema <http://blog.sendapatch.se/category/json_schema.html>`__.
|
||||
|
||||
I greatly prefer the light-weight style promoted by these libraries to
|
||||
the complexity of libraries like FormEncode.
|
||||
|
||||
.. |Build Status| image:: https://travis-ci.org/alecthomas/voluptuous.png
|
||||
:target: https://travis-ci.org/alecthomas/voluptuous
|
||||
.. |Stories in Ready| image:: https://badge.waffle.io/alecthomas/voluptuous.png?label=ready&title=Ready
|
||||
:target: https://waffle.io/alecthomas/voluptuous
|
||||
|
||||
Platform: any
|
||||
Classifier: Development Status :: 5 - Production/Stable
|
||||
Classifier: Intended Audience :: Developers
|
||||
Classifier: License :: OSI Approved :: BSD License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Classifier: Programming Language :: Python :: 2
|
||||
Classifier: Programming Language :: Python :: 2.7
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: Programming Language :: Python :: 3.1
|
||||
Classifier: Programming Language :: Python :: 3.2
|
||||
Classifier: Programming Language :: Python :: 3.3
|
||||
Classifier: Programming Language :: Python :: 3.4
|
|
@ -0,0 +1,596 @@
|
|||
# Voluptuous is a Python data validation library
|
||||
|
||||
[![Build Status](https://travis-ci.org/alecthomas/voluptuous.png)](https://travis-ci.org/alecthomas/voluptuous) [![Stories in Ready](https://badge.waffle.io/alecthomas/voluptuous.png?label=ready&title=Ready)](https://waffle.io/alecthomas/voluptuous)
|
||||
|
||||
Voluptuous, *despite* the name, is a Python data validation library. It
|
||||
is primarily intended for validating data coming into Python as JSON,
|
||||
YAML, etc.
|
||||
|
||||
It has three goals:
|
||||
|
||||
1. Simplicity.
|
||||
2. Support for complex data structures.
|
||||
3. Provide useful error messages.
|
||||
|
||||
## Contact
|
||||
|
||||
Voluptuous now has a mailing list! Send a mail to
|
||||
[<voluptuous@librelist.com>](mailto:voluptuous@librelist.com) to subscribe. Instructions
|
||||
will follow.
|
||||
|
||||
You can also contact me directly via [email](mailto:alec@swapoff.org) or
|
||||
[Twitter](https://twitter.com/alecthomas).
|
||||
|
||||
To file a bug, create a [new issue](https://github.com/alecthomas/voluptuous/issues/new) on GitHub with a short example of how to replicate the issue.
|
||||
|
||||
## Show me an example
|
||||
|
||||
Twitter's [user search API](https://dev.twitter.com/docs/api/1/get/users/search) accepts
|
||||
query URLs like:
|
||||
|
||||
```
|
||||
$ curl 'http://api.twitter.com/1/users/search.json?q=python&per_page=20&page=1
|
||||
```
|
||||
|
||||
To validate this we might use a schema like:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Schema
|
||||
>>> schema = Schema({
|
||||
... 'q': str,
|
||||
... 'per_page': int,
|
||||
... 'page': int,
|
||||
... })
|
||||
|
||||
```
|
||||
|
||||
This schema very succinctly and roughly describes the data required by
|
||||
the API, and will work fine. But it has a few problems. Firstly, it
|
||||
doesn't fully express the constraints of the API. According to the API,
|
||||
`per_page` should be restricted to at most 20, defaulting to 5, for
|
||||
example. To describe the semantics of the API more accurately, our
|
||||
schema will need to be more thoroughly defined:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Required, All, Length, Range
|
||||
>>> schema = Schema({
|
||||
... Required('q'): All(str, Length(min=1)),
|
||||
... Required('per_page', default=5): All(int, Range(min=1, max=20)),
|
||||
... 'page': All(int, Range(min=0)),
|
||||
... })
|
||||
|
||||
```
|
||||
|
||||
This schema fully enforces the interface defined in Twitter's
|
||||
documentation, and goes a little further for completeness.
|
||||
|
||||
"q" is required:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import MultipleInvalid, Invalid
|
||||
>>> try:
|
||||
... schema({})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data['q']"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
...must be a string:
|
||||
|
||||
```pycon
|
||||
>>> try:
|
||||
... schema({'q': 123})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected str for dictionary value @ data['q']"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
...and must be at least one character in length:
|
||||
|
||||
```pycon
|
||||
>>> try:
|
||||
... schema({'q': ''})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "length of value must be at least 1 for dictionary value @ data['q']"
|
||||
True
|
||||
>>> schema({'q': '#topic'}) == {'q': '#topic', 'per_page': 5}
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
"per\_page" is a positive integer no greater than 20:
|
||||
|
||||
```pycon
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': 900})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "value must be at most 20 for dictionary value @ data['per_page']"
|
||||
True
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': -10})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "value must be at least 1 for dictionary value @ data['per_page']"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
"page" is an integer \>= 0:
|
||||
|
||||
```pycon
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': 'one'})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"expected int for dictionary value @ data['per_page']"
|
||||
>>> schema({'q': '#topic', 'page': 1}) == {'q': '#topic', 'page': 1, 'per_page': 5}
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
## Defining schemas
|
||||
|
||||
Schemas are nested data structures consisting of dictionaries, lists,
|
||||
scalars and *validators*. Each node in the input schema is pattern
|
||||
matched against corresponding nodes in the input data.
|
||||
|
||||
### Literals
|
||||
|
||||
Literals in the schema are matched using normal equality checks:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema(1)
|
||||
>>> schema(1)
|
||||
1
|
||||
>>> schema = Schema('a string')
|
||||
>>> schema('a string')
|
||||
'a string'
|
||||
|
||||
```
|
||||
|
||||
### Types
|
||||
|
||||
Types in the schema are matched by checking if the corresponding value
|
||||
is an instance of the type:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema(int)
|
||||
>>> schema(1)
|
||||
1
|
||||
>>> try:
|
||||
... schema('one')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected int"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
### URL's
|
||||
|
||||
URL's in the schema are matched by using `urlparse` library.
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Url
|
||||
>>> schema = Schema(Url())
|
||||
>>> schema('http://w3.org')
|
||||
'http://w3.org'
|
||||
>>> try:
|
||||
... schema('one')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected a URL"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
### Lists
|
||||
|
||||
Lists in the schema are treated as a set of valid values. Each element
|
||||
in the schema list is compared to each value in the input data:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema([1, 'a', 'string'])
|
||||
>>> schema([1])
|
||||
[1]
|
||||
>>> schema([1, 1, 1])
|
||||
[1, 1, 1]
|
||||
>>> schema(['a', 1, 'string', 1, 'string'])
|
||||
['a', 1, 'string', 1, 'string']
|
||||
|
||||
```
|
||||
|
||||
### Validation functions
|
||||
|
||||
Validators are simple callables that raise an `Invalid` exception when
|
||||
they encounter invalid data. The criteria for determining validity is
|
||||
entirely up to the implementation; it may check that a value is a valid
|
||||
username with `pwd.getpwnam()`, it may check that a value is of a
|
||||
specific type, and so on.
|
||||
|
||||
The simplest kind of validator is a Python function that raises
|
||||
ValueError when its argument is invalid. Conveniently, many builtin
|
||||
Python functions have this property. Here's an example of a date
|
||||
validator:
|
||||
|
||||
```pycon
|
||||
>>> from datetime import datetime
|
||||
>>> def Date(fmt='%Y-%m-%d'):
|
||||
... return lambda v: datetime.strptime(v, fmt)
|
||||
|
||||
```
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema(Date())
|
||||
>>> schema('2013-03-03')
|
||||
datetime.datetime(2013, 3, 3, 0, 0)
|
||||
>>> try:
|
||||
... schema('2013-03')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "not a valid value"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
In addition to simply determining if a value is valid, validators may
|
||||
mutate the value into a valid form. An example of this is the
|
||||
`Coerce(type)` function, which returns a function that coerces its
|
||||
argument to the given type:
|
||||
|
||||
```python
|
||||
def Coerce(type, msg=None):
|
||||
"""Coerce a value to a type.
|
||||
|
||||
If the type constructor throws a ValueError, the value will be marked as
|
||||
Invalid.
|
||||
"""
|
||||
def f(v):
|
||||
try:
|
||||
return type(v)
|
||||
except ValueError:
|
||||
raise Invalid(msg or ('expected %s' % type.__name__))
|
||||
return f
|
||||
|
||||
```
|
||||
|
||||
This example also shows a common idiom where an optional human-readable
|
||||
message can be provided. This can vastly improve the usefulness of the
|
||||
resulting error messages.
|
||||
|
||||
### Dictionaries
|
||||
|
||||
Each key-value pair in a schema dictionary is validated against each
|
||||
key-value pair in the corresponding data dictionary:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema({1: 'one', 2: 'two'})
|
||||
>>> schema({1: 'one'})
|
||||
{1: 'one'}
|
||||
|
||||
```
|
||||
|
||||
#### Extra dictionary keys
|
||||
|
||||
By default any additional keys in the data, not in the schema will
|
||||
trigger exceptions:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema({2: 3})
|
||||
>>> try:
|
||||
... schema({1: 2, 2: 3})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "extra keys not allowed @ data[1]"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
This behaviour can be altered on a per-schema basis. To allow
|
||||
additional keys use
|
||||
`Schema(..., extra=ALLOW_EXTRA)`:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import ALLOW_EXTRA
|
||||
>>> schema = Schema({2: 3}, extra=ALLOW_EXTRA)
|
||||
>>> schema({1: 2, 2: 3})
|
||||
{1: 2, 2: 3}
|
||||
|
||||
```
|
||||
|
||||
To remove additional keys use
|
||||
`Schema(..., extra=REMOVE_EXTRA)`:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import REMOVE_EXTRA
|
||||
>>> schema = Schema({2: 3}, extra=REMOVE_EXTRA)
|
||||
>>> schema({1: 2, 2: 3})
|
||||
{2: 3}
|
||||
|
||||
```
|
||||
|
||||
It can also be overridden per-dictionary by using the catch-all marker
|
||||
token `extra` as a key:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Extra
|
||||
>>> schema = Schema({1: {Extra: object}})
|
||||
>>> schema({1: {'foo': 'bar'}})
|
||||
{1: {'foo': 'bar'}}
|
||||
|
||||
```
|
||||
|
||||
#### Required dictionary keys
|
||||
|
||||
By default, keys in the schema are not required to be in the data:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema({1: 2, 3: 4})
|
||||
>>> schema({3: 4})
|
||||
{3: 4}
|
||||
|
||||
```
|
||||
|
||||
Similarly to how extra\_ keys work, this behaviour can be overridden
|
||||
per-schema:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema({1: 2, 3: 4}, required=True)
|
||||
>>> try:
|
||||
... schema({3: 4})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
And per-key, with the marker token `Required(key)`:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema({Required(1): 2, 3: 4})
|
||||
>>> try:
|
||||
... schema({3: 4})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
>>> schema({1: 2})
|
||||
{1: 2}
|
||||
|
||||
```
|
||||
|
||||
#### Optional dictionary keys
|
||||
|
||||
If a schema has `required=True`, keys may be individually marked as
|
||||
optional using the marker token `Optional(key)`:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Optional
|
||||
>>> schema = Schema({1: 2, Optional(3): 4}, required=True)
|
||||
>>> try:
|
||||
... schema({})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
>>> schema({1: 2})
|
||||
{1: 2}
|
||||
>>> try:
|
||||
... schema({1: 2, 4: 5})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "extra keys not allowed @ data[4]"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
```pycon
|
||||
>>> schema({1: 2, 3: 4})
|
||||
{1: 2, 3: 4}
|
||||
|
||||
```
|
||||
|
||||
### Recursive schema
|
||||
|
||||
There is no syntax to have a recursive schema. The best way to do it is to have a wrapper like this:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Schema, Any
|
||||
>>> def s2(v):
|
||||
... return s1(v)
|
||||
...
|
||||
>>> s1 = Schema({"key": Any(s2, "value")})
|
||||
>>> s1({"key": {"key": "value"}})
|
||||
{'key': {'key': 'value'}}
|
||||
|
||||
```
|
||||
|
||||
### Extending an existing Schema
|
||||
|
||||
Often it comes handy to have a base `Schema` that is extended with more
|
||||
requirements. In that case you can use `Schema.extend` to create a new
|
||||
`Schema`:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Schema
|
||||
>>> person = Schema({'name': str})
|
||||
>>> person_with_age = person.extend({'age': int})
|
||||
>>> sorted(list(person_with_age.schema.keys()))
|
||||
['age', 'name']
|
||||
|
||||
```
|
||||
|
||||
The original `Schema` remains unchanged.
|
||||
|
||||
### Objects
|
||||
|
||||
Each key-value pair in a schema dictionary is validated against each
|
||||
attribute-value pair in the corresponding object:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Object
|
||||
>>> class Structure(object):
|
||||
... def __init__(self, q=None):
|
||||
... self.q = q
|
||||
... def __repr__(self):
|
||||
... return '<Structure(q={0.q!r})>'.format(self)
|
||||
...
|
||||
>>> schema = Schema(Object({'q': 'one'}, cls=Structure))
|
||||
>>> schema(Structure(q='one'))
|
||||
<Structure(q='one')>
|
||||
|
||||
```
|
||||
|
||||
### Allow None values
|
||||
|
||||
To allow value to be None as well, use Any:
|
||||
|
||||
```pycon
|
||||
>>> from voluptuous import Any
|
||||
|
||||
>>> schema = Schema(Any(None, int))
|
||||
>>> schema(None)
|
||||
>>> schema(5)
|
||||
5
|
||||
|
||||
```
|
||||
|
||||
## Error reporting
|
||||
|
||||
Validators must throw an `Invalid` exception if invalid data is passed
|
||||
to them. All other exceptions are treated as errors in the validator and
|
||||
will not be caught.
|
||||
|
||||
Each `Invalid` exception has an associated `path` attribute representing
|
||||
the path in the data structure to our currently validating value, as well
|
||||
as an `error_message` attribute that contains the message of the original
|
||||
exception. This is especially useful when you want to catch `Invalid`
|
||||
exceptions and give some feedback to the user, for instance in the context of
|
||||
an HTTP API.
|
||||
|
||||
|
||||
```pycon
|
||||
>>> def validate_email(email):
|
||||
... """Validate email."""
|
||||
... if not "@" in email:
|
||||
... raise Invalid("This email is invalid.")
|
||||
... return email
|
||||
>>> schema = Schema({"email": validate_email})
|
||||
>>> exc = None
|
||||
>>> try:
|
||||
... schema({"email": "whatever"})
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"This email is invalid. for dictionary value @ data['email']"
|
||||
>>> exc.path
|
||||
['email']
|
||||
>>> exc.msg
|
||||
'This email is invalid.'
|
||||
>>> exc.error_message
|
||||
'This email is invalid.'
|
||||
|
||||
```
|
||||
|
||||
The `path` attribute is used during error reporting, but also during matching
|
||||
to determine whether an error should be reported to the user or if the next
|
||||
match should be attempted. This is determined by comparing the depth of the
|
||||
path where the check is, to the depth of the path where the error occurred. If
|
||||
the error is more than one level deeper, it is reported.
|
||||
|
||||
The upshot of this is that *matching is depth-first and fail-fast*.
|
||||
|
||||
To illustrate this, here is an example schema:
|
||||
|
||||
```pycon
|
||||
>>> schema = Schema([[2, 3], 6])
|
||||
|
||||
```
|
||||
|
||||
Each value in the top-level list is matched depth-first in-order. Given
|
||||
input data of `[[6]]`, the inner list will match the first element of
|
||||
the schema, but the literal `6` will not match any of the elements of
|
||||
that list. This error will be reported back to the user immediately. No
|
||||
backtracking is attempted:
|
||||
|
||||
```pycon
|
||||
>>> try:
|
||||
... schema([[6]])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "not a valid value @ data[0][0]"
|
||||
True
|
||||
|
||||
```
|
||||
|
||||
If we pass the data `[6]`, the `6` is not a list type and so will not
|
||||
recurse into the first element of the schema. Matching will continue on
|
||||
to the second element in the schema, and succeed:
|
||||
|
||||
```pycon
|
||||
>>> schema([6])
|
||||
[6]
|
||||
|
||||
```
|
||||
|
||||
## Running tests.
|
||||
|
||||
Voluptuous is using nosetests:
|
||||
|
||||
$ nosetests
|
||||
|
||||
|
||||
## Why use Voluptuous over another validation library?
|
||||
|
||||
**Validators are simple callables**
|
||||
: No need to subclass anything, just use a function.
|
||||
|
||||
**Errors are simple exceptions.**
|
||||
: A validator can just `raise Invalid(msg)` and expect the user to get
|
||||
useful messages.
|
||||
|
||||
**Schemas are basic Python data structures.**
|
||||
: Should your data be a dictionary of integer keys to strings?
|
||||
`{int: str}` does what you expect. List of integers, floats or
|
||||
strings? `[int, float, str]`.
|
||||
|
||||
**Designed from the ground up for validating more than just forms.**
|
||||
: Nested data structures are treated in the same way as any other
|
||||
type. Need a list of dictionaries? `[{}]`
|
||||
|
||||
**Consistency.**
|
||||
: Types in the schema are checked as types. Values are compared as
|
||||
values. Callables are called to validate. Simple.
|
||||
|
||||
## Other libraries and inspirations
|
||||
|
||||
Voluptuous is heavily inspired by
|
||||
[Validino](http://code.google.com/p/validino/), and to a lesser extent,
|
||||
[jsonvalidator](http://code.google.com/p/jsonvalidator/) and
|
||||
[json\_schema](http://blog.sendapatch.se/category/json_schema.html).
|
||||
|
||||
I greatly prefer the light-weight style promoted by these libraries to
|
||||
the complexity of libraries like FormEncode.
|
|
@ -0,0 +1,589 @@
|
|||
Voluptuous is a Python data validation library
|
||||
==============================================
|
||||
|
||||
|Build Status| |Stories in Ready|
|
||||
|
||||
Voluptuous, *despite* the name, is a Python data validation library. It
|
||||
is primarily intended for validating data coming into Python as JSON,
|
||||
YAML, etc.
|
||||
|
||||
It has three goals:
|
||||
|
||||
1. Simplicity.
|
||||
2. Support for complex data structures.
|
||||
3. Provide useful error messages.
|
||||
|
||||
Contact
|
||||
-------
|
||||
|
||||
Voluptuous now has a mailing list! Send a mail to
|
||||
` <mailto:voluptuous@librelist.com>`__ to subscribe. Instructions will
|
||||
follow.
|
||||
|
||||
You can also contact me directly via `email <mailto:alec@swapoff.org>`__
|
||||
or `Twitter <https://twitter.com/alecthomas>`__.
|
||||
|
||||
To file a bug, create a `new
|
||||
issue <https://github.com/alecthomas/voluptuous/issues/new>`__ on GitHub
|
||||
with a short example of how to replicate the issue.
|
||||
|
||||
Show me an example
|
||||
------------------
|
||||
|
||||
Twitter's `user search
|
||||
API <https://dev.twitter.com/docs/api/1/get/users/search>`__ accepts
|
||||
query URLs like:
|
||||
|
||||
::
|
||||
|
||||
$ curl 'http://api.twitter.com/1/users/search.json?q=python&per_page=20&page=1
|
||||
|
||||
To validate this we might use a schema like:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Schema
|
||||
>>> schema = Schema({
|
||||
... 'q': str,
|
||||
... 'per_page': int,
|
||||
... 'page': int,
|
||||
... })
|
||||
|
||||
This schema very succinctly and roughly describes the data required by
|
||||
the API, and will work fine. But it has a few problems. Firstly, it
|
||||
doesn't fully express the constraints of the API. According to the API,
|
||||
``per_page`` should be restricted to at most 20, defaulting to 5, for
|
||||
example. To describe the semantics of the API more accurately, our
|
||||
schema will need to be more thoroughly defined:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Required, All, Length, Range
|
||||
>>> schema = Schema({
|
||||
... Required('q'): All(str, Length(min=1)),
|
||||
... Required('per_page', default=5): All(int, Range(min=1, max=20)),
|
||||
... 'page': All(int, Range(min=0)),
|
||||
... })
|
||||
|
||||
This schema fully enforces the interface defined in Twitter's
|
||||
documentation, and goes a little further for completeness.
|
||||
|
||||
"q" is required:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import MultipleInvalid, Invalid
|
||||
>>> try:
|
||||
... schema({})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data['q']"
|
||||
True
|
||||
|
||||
...must be a string:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': 123})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected str for dictionary value @ data['q']"
|
||||
True
|
||||
|
||||
...and must be at least one character in length:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': ''})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "length of value must be at least 1 for dictionary value @ data['q']"
|
||||
True
|
||||
>>> schema({'q': '#topic'}) == {'q': '#topic', 'per_page': 5}
|
||||
True
|
||||
|
||||
"per\_page" is a positive integer no greater than 20:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': 900})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "value must be at most 20 for dictionary value @ data['per_page']"
|
||||
True
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': -10})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "value must be at least 1 for dictionary value @ data['per_page']"
|
||||
True
|
||||
|
||||
"page" is an integer >= 0:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema({'q': '#topic', 'per_page': 'one'})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"expected int for dictionary value @ data['per_page']"
|
||||
>>> schema({'q': '#topic', 'page': 1}) == {'q': '#topic', 'page': 1, 'per_page': 5}
|
||||
True
|
||||
|
||||
Defining schemas
|
||||
----------------
|
||||
|
||||
Schemas are nested data structures consisting of dictionaries, lists,
|
||||
scalars and *validators*. Each node in the input schema is pattern
|
||||
matched against corresponding nodes in the input data.
|
||||
|
||||
Literals
|
||||
~~~~~~~~
|
||||
|
||||
Literals in the schema are matched using normal equality checks:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema(1)
|
||||
>>> schema(1)
|
||||
1
|
||||
>>> schema = Schema('a string')
|
||||
>>> schema('a string')
|
||||
'a string'
|
||||
|
||||
Types
|
||||
~~~~~
|
||||
|
||||
Types in the schema are matched by checking if the corresponding value
|
||||
is an instance of the type:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema(int)
|
||||
>>> schema(1)
|
||||
1
|
||||
>>> try:
|
||||
... schema('one')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected int"
|
||||
True
|
||||
|
||||
URL's
|
||||
~~~~~
|
||||
|
||||
URL's in the schema are matched by using ``urlparse`` library.
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Url
|
||||
>>> schema = Schema(Url())
|
||||
>>> schema('http://w3.org')
|
||||
'http://w3.org'
|
||||
>>> try:
|
||||
... schema('one')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "expected a URL"
|
||||
True
|
||||
|
||||
Lists
|
||||
~~~~~
|
||||
|
||||
Lists in the schema are treated as a set of valid values. Each element
|
||||
in the schema list is compared to each value in the input data:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema([1, 'a', 'string'])
|
||||
>>> schema([1])
|
||||
[1]
|
||||
>>> schema([1, 1, 1])
|
||||
[1, 1, 1]
|
||||
>>> schema(['a', 1, 'string', 1, 'string'])
|
||||
['a', 1, 'string', 1, 'string']
|
||||
|
||||
Validation functions
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Validators are simple callables that raise an ``Invalid`` exception when
|
||||
they encounter invalid data. The criteria for determining validity is
|
||||
entirely up to the implementation; it may check that a value is a valid
|
||||
username with ``pwd.getpwnam()``, it may check that a value is of a
|
||||
specific type, and so on.
|
||||
|
||||
The simplest kind of validator is a Python function that raises
|
||||
ValueError when its argument is invalid. Conveniently, many builtin
|
||||
Python functions have this property. Here's an example of a date
|
||||
validator:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from datetime import datetime
|
||||
>>> def Date(fmt='%Y-%m-%d'):
|
||||
... return lambda v: datetime.strptime(v, fmt)
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema(Date())
|
||||
>>> schema('2013-03-03')
|
||||
datetime.datetime(2013, 3, 3, 0, 0)
|
||||
>>> try:
|
||||
... schema('2013-03')
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "not a valid value"
|
||||
True
|
||||
|
||||
In addition to simply determining if a value is valid, validators may
|
||||
mutate the value into a valid form. An example of this is the
|
||||
``Coerce(type)`` function, which returns a function that coerces its
|
||||
argument to the given type:
|
||||
|
||||
.. code:: python
|
||||
|
||||
def Coerce(type, msg=None):
|
||||
"""Coerce a value to a type.
|
||||
|
||||
If the type constructor throws a ValueError, the value will be marked as
|
||||
Invalid.
|
||||
"""
|
||||
def f(v):
|
||||
try:
|
||||
return type(v)
|
||||
except ValueError:
|
||||
raise Invalid(msg or ('expected %s' % type.__name__))
|
||||
return f
|
||||
|
||||
This example also shows a common idiom where an optional human-readable
|
||||
message can be provided. This can vastly improve the usefulness of the
|
||||
resulting error messages.
|
||||
|
||||
Dictionaries
|
||||
~~~~~~~~~~~~
|
||||
|
||||
Each key-value pair in a schema dictionary is validated against each
|
||||
key-value pair in the corresponding data dictionary:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({1: 'one', 2: 'two'})
|
||||
>>> schema({1: 'one'})
|
||||
{1: 'one'}
|
||||
|
||||
Extra dictionary keys
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By default any additional keys in the data, not in the schema will
|
||||
trigger exceptions:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({2: 3})
|
||||
>>> try:
|
||||
... schema({1: 2, 2: 3})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "extra keys not allowed @ data[1]"
|
||||
True
|
||||
|
||||
This behaviour can be altered on a per-schema basis. To allow additional
|
||||
keys use ``Schema(..., extra=ALLOW_EXTRA)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import ALLOW_EXTRA
|
||||
>>> schema = Schema({2: 3}, extra=ALLOW_EXTRA)
|
||||
>>> schema({1: 2, 2: 3})
|
||||
{1: 2, 2: 3}
|
||||
|
||||
To remove additional keys use ``Schema(..., extra=REMOVE_EXTRA)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import REMOVE_EXTRA
|
||||
>>> schema = Schema({2: 3}, extra=REMOVE_EXTRA)
|
||||
>>> schema({1: 2, 2: 3})
|
||||
{2: 3}
|
||||
|
||||
It can also be overridden per-dictionary by using the catch-all marker
|
||||
token ``extra`` as a key:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Extra
|
||||
>>> schema = Schema({1: {Extra: object}})
|
||||
>>> schema({1: {'foo': 'bar'}})
|
||||
{1: {'foo': 'bar'}}
|
||||
|
||||
Required dictionary keys
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
By default, keys in the schema are not required to be in the data:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({1: 2, 3: 4})
|
||||
>>> schema({3: 4})
|
||||
{3: 4}
|
||||
|
||||
Similarly to how extra\_ keys work, this behaviour can be overridden
|
||||
per-schema:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({1: 2, 3: 4}, required=True)
|
||||
>>> try:
|
||||
... schema({3: 4})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
|
||||
And per-key, with the marker token ``Required(key)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema({Required(1): 2, 3: 4})
|
||||
>>> try:
|
||||
... schema({3: 4})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
>>> schema({1: 2})
|
||||
{1: 2}
|
||||
|
||||
Optional dictionary keys
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
If a schema has ``required=True``, keys may be individually marked as
|
||||
optional using the marker token ``Optional(key)``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Optional
|
||||
>>> schema = Schema({1: 2, Optional(3): 4}, required=True)
|
||||
>>> try:
|
||||
... schema({})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "required key not provided @ data[1]"
|
||||
True
|
||||
>>> schema({1: 2})
|
||||
{1: 2}
|
||||
>>> try:
|
||||
... schema({1: 2, 4: 5})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "extra keys not allowed @ data[4]"
|
||||
True
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema({1: 2, 3: 4})
|
||||
{1: 2, 3: 4}
|
||||
|
||||
Recursive schema
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
There is no syntax to have a recursive schema. The best way to do it is
|
||||
to have a wrapper like this:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Schema, Any
|
||||
>>> def s2(v):
|
||||
... return s1(v)
|
||||
...
|
||||
>>> s1 = Schema({"key": Any(s2, "value")})
|
||||
>>> s1({"key": {"key": "value"}})
|
||||
{'key': {'key': 'value'}}
|
||||
|
||||
Extending an existing Schema
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Often it comes handy to have a base ``Schema`` that is extended with
|
||||
more requirements. In that case you can use ``Schema.extend`` to create
|
||||
a new ``Schema``:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Schema
|
||||
>>> person = Schema({'name': str})
|
||||
>>> person_with_age = person.extend({'age': int})
|
||||
>>> sorted(list(person_with_age.schema.keys()))
|
||||
['age', 'name']
|
||||
|
||||
The original ``Schema`` remains unchanged.
|
||||
|
||||
Objects
|
||||
~~~~~~~
|
||||
|
||||
Each key-value pair in a schema dictionary is validated against each
|
||||
attribute-value pair in the corresponding object:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Object
|
||||
>>> class Structure(object):
|
||||
... def __init__(self, q=None):
|
||||
... self.q = q
|
||||
... def __repr__(self):
|
||||
... return '<Structure(q={0.q!r})>'.format(self)
|
||||
...
|
||||
>>> schema = Schema(Object({'q': 'one'}, cls=Structure))
|
||||
>>> schema(Structure(q='one'))
|
||||
<Structure(q='one')>
|
||||
|
||||
Allow None values
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
To allow value to be None as well, use Any:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> from voluptuous import Any
|
||||
|
||||
>>> schema = Schema(Any(None, int))
|
||||
>>> schema(None)
|
||||
>>> schema(5)
|
||||
5
|
||||
|
||||
Error reporting
|
||||
---------------
|
||||
|
||||
Validators must throw an ``Invalid`` exception if invalid data is passed
|
||||
to them. All other exceptions are treated as errors in the validator and
|
||||
will not be caught.
|
||||
|
||||
Each ``Invalid`` exception has an associated ``path`` attribute
|
||||
representing the path in the data structure to our currently validating
|
||||
value, as well as an ``error_message`` attribute that contains the
|
||||
message of the original exception. This is especially useful when you
|
||||
want to catch ``Invalid`` exceptions and give some feedback to the user,
|
||||
for instance in the context of an HTTP API.
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> def validate_email(email):
|
||||
... """Validate email."""
|
||||
... if not "@" in email:
|
||||
... raise Invalid("This email is invalid.")
|
||||
... return email
|
||||
>>> schema = Schema({"email": validate_email})
|
||||
>>> exc = None
|
||||
>>> try:
|
||||
... schema({"email": "whatever"})
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"This email is invalid. for dictionary value @ data['email']"
|
||||
>>> exc.path
|
||||
['email']
|
||||
>>> exc.msg
|
||||
'This email is invalid.'
|
||||
>>> exc.error_message
|
||||
'This email is invalid.'
|
||||
|
||||
The ``path`` attribute is used during error reporting, but also during
|
||||
matching to determine whether an error should be reported to the user or
|
||||
if the next match should be attempted. This is determined by comparing
|
||||
the depth of the path where the check is, to the depth of the path where
|
||||
the error occurred. If the error is more than one level deeper, it is
|
||||
reported.
|
||||
|
||||
The upshot of this is that *matching is depth-first and fail-fast*.
|
||||
|
||||
To illustrate this, here is an example schema:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema = Schema([[2, 3], 6])
|
||||
|
||||
Each value in the top-level list is matched depth-first in-order. Given
|
||||
input data of ``[[6]]``, the inner list will match the first element of
|
||||
the schema, but the literal ``6`` will not match any of the elements of
|
||||
that list. This error will be reported back to the user immediately. No
|
||||
backtracking is attempted:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> try:
|
||||
... schema([[6]])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == "not a valid value @ data[0][0]"
|
||||
True
|
||||
|
||||
If we pass the data ``[6]``, the ``6`` is not a list type and so will
|
||||
not recurse into the first element of the schema. Matching will continue
|
||||
on to the second element in the schema, and succeed:
|
||||
|
||||
.. code:: pycon
|
||||
|
||||
>>> schema([6])
|
||||
[6]
|
||||
|
||||
Running tests.
|
||||
--------------
|
||||
|
||||
Voluptuous is using nosetests:
|
||||
|
||||
::
|
||||
|
||||
$ nosetests
|
||||
|
||||
Why use Voluptuous over another validation library?
|
||||
---------------------------------------------------
|
||||
|
||||
**Validators are simple callables**
|
||||
No need to subclass anything, just use a function.
|
||||
**Errors are simple exceptions.**
|
||||
A validator can just ``raise Invalid(msg)`` and expect the user to
|
||||
get useful messages.
|
||||
**Schemas are basic Python data structures.**
|
||||
Should your data be a dictionary of integer keys to strings?
|
||||
``{int: str}`` does what you expect. List of integers, floats or
|
||||
strings? ``[int, float, str]``.
|
||||
**Designed from the ground up for validating more than just forms.**
|
||||
Nested data structures are treated in the same way as any other
|
||||
type. Need a list of dictionaries? ``[{}]``
|
||||
**Consistency.**
|
||||
Types in the schema are checked as types. Values are compared as
|
||||
values. Callables are called to validate. Simple.
|
||||
|
||||
Other libraries and inspirations
|
||||
--------------------------------
|
||||
|
||||
Voluptuous is heavily inspired by
|
||||
`Validino <http://code.google.com/p/validino/>`__, and to a lesser
|
||||
extent, `jsonvalidator <http://code.google.com/p/jsonvalidator/>`__ and
|
||||
`json\_schema <http://blog.sendapatch.se/category/json_schema.html>`__.
|
||||
|
||||
I greatly prefer the light-weight style promoted by these libraries to
|
||||
the complexity of libraries like FormEncode.
|
||||
|
||||
.. |Build Status| image:: https://travis-ci.org/alecthomas/voluptuous.png
|
||||
:target: https://travis-ci.org/alecthomas/voluptuous
|
||||
.. |Stories in Ready| image:: https://badge.waffle.io/alecthomas/voluptuous.png?label=ready&title=Ready
|
||||
:target: https://waffle.io/alecthomas/voluptuous
|
|
@ -0,0 +1,10 @@
|
|||
[nosetests]
|
||||
doctest-extension = md
|
||||
with-doctest = 1
|
||||
where = .
|
||||
|
||||
[egg_info]
|
||||
tag_build =
|
||||
tag_date = 0
|
||||
tag_svn_revision = 0
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
try:
|
||||
from setuptools import setup
|
||||
except ImportError:
|
||||
from distutils.core import setup
|
||||
|
||||
import sys
|
||||
import os
|
||||
import atexit
|
||||
sys.path.insert(0, '.')
|
||||
version = __import__('voluptuous').__version__
|
||||
|
||||
try:
|
||||
import pypandoc
|
||||
long_description = pypandoc.convert('README.md', 'rst')
|
||||
with open('README.rst', 'w') as f:
|
||||
f.write(long_description)
|
||||
atexit.register(lambda: os.unlink('README.rst'))
|
||||
except (ImportError, OSError):
|
||||
print('WARNING: Could not locate pandoc, using Markdown long_description.')
|
||||
with open('README.md') as f:
|
||||
long_description = f.read()
|
||||
|
||||
description = long_description.splitlines()[0].strip()
|
||||
|
||||
|
||||
setup(
|
||||
name='voluptuous',
|
||||
url='https://github.com/alecthomas/voluptuous',
|
||||
download_url='https://pypi.python.org/pypi/voluptuous',
|
||||
version=version,
|
||||
description=description,
|
||||
long_description=long_description,
|
||||
license='BSD',
|
||||
platforms=['any'],
|
||||
py_modules=['voluptuous'],
|
||||
author='Alec Thomas',
|
||||
author_email='alec@swapoff.org',
|
||||
classifiers=[
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Intended Audience :: Developers',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Operating System :: OS Independent',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.1',
|
||||
'Programming Language :: Python :: 3.2',
|
||||
'Programming Language :: Python :: 3.3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
],
|
||||
install_requires=[
|
||||
'setuptools >= 0.6b1',
|
||||
],
|
||||
)
|
|
@ -0,0 +1,268 @@
|
|||
Error reporting should be accurate:
|
||||
|
||||
>>> from voluptuous import *
|
||||
>>> schema = Schema(['one', {'two': 'three', 'four': ['five'],
|
||||
... 'six': {'seven': 'eight'}}])
|
||||
>>> schema(['one'])
|
||||
['one']
|
||||
>>> schema([{'two': 'three'}])
|
||||
[{'two': 'three'}]
|
||||
|
||||
It should show the exact index and container type, in this case a list
|
||||
value:
|
||||
|
||||
>>> try:
|
||||
... schema(['one', 'two'])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc) == 'expected a dictionary @ data[1]'
|
||||
True
|
||||
|
||||
It should also be accurate for nested values:
|
||||
|
||||
>>> try:
|
||||
... schema([{'two': 'nine'}])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"not a valid value for dictionary value @ data[0]['two']"
|
||||
|
||||
>>> try:
|
||||
... schema([{'four': ['nine']}])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"not a valid value @ data[0]['four'][0]"
|
||||
|
||||
>>> try:
|
||||
... schema([{'six': {'seven': 'nine'}}])
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"not a valid value for dictionary value @ data[0]['six']['seven']"
|
||||
|
||||
Errors should be reported depth-first:
|
||||
|
||||
>>> validate = Schema({'one': {'two': 'three', 'four': 'five'}})
|
||||
>>> try:
|
||||
... validate({'one': {'four': 'six'}})
|
||||
... except Invalid as e:
|
||||
... print(e)
|
||||
... print(e.path)
|
||||
not a valid value for dictionary value @ data['one']['four']
|
||||
['one', 'four']
|
||||
|
||||
Voluptuous supports validation when extra fields are present in the
|
||||
data:
|
||||
|
||||
>>> schema = Schema({'one': 1, Extra: object})
|
||||
>>> schema({'two': 'two', 'one': 1}) == {'two': 'two', 'one': 1}
|
||||
True
|
||||
>>> schema = Schema({'one': 1})
|
||||
>>> try:
|
||||
... schema({'two': 2})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"extra keys not allowed @ data['two']"
|
||||
|
||||
dict, list, and tuple should be available as type validators:
|
||||
|
||||
>>> Schema(dict)({'a': 1, 'b': 2}) == {'a': 1, 'b': 2}
|
||||
True
|
||||
>>> Schema(list)([1,2,3])
|
||||
[1, 2, 3]
|
||||
>>> Schema(tuple)((1,2,3))
|
||||
(1, 2, 3)
|
||||
|
||||
Validation should return instances of the right types when the types are
|
||||
subclasses of dict or list:
|
||||
|
||||
>>> class Dict(dict):
|
||||
... pass
|
||||
>>>
|
||||
>>> d = Schema(dict)(Dict(a=1, b=2))
|
||||
>>> d == {'a': 1, 'b': 2}
|
||||
True
|
||||
>>> type(d) is Dict
|
||||
True
|
||||
>>> class List(list):
|
||||
... pass
|
||||
>>>
|
||||
>>> l = Schema(list)(List([1,2,3]))
|
||||
>>> l
|
||||
[1, 2, 3]
|
||||
>>> type(l) is List
|
||||
True
|
||||
|
||||
Multiple errors are reported:
|
||||
|
||||
>>> schema = Schema({'one': 1, 'two': 2})
|
||||
>>> try:
|
||||
... schema({'one': 2, 'two': 3, 'three': 4})
|
||||
... except MultipleInvalid as e:
|
||||
... errors = sorted(e.errors, key=lambda k: str(k))
|
||||
... print([str(i) for i in errors]) # doctest: +NORMALIZE_WHITESPACE
|
||||
["extra keys not allowed @ data['three']",
|
||||
"not a valid value for dictionary value @ data['one']",
|
||||
"not a valid value for dictionary value @ data['two']"]
|
||||
>>> schema = Schema([[1], [2], [3]])
|
||||
>>> try:
|
||||
... schema([1, 2, 3])
|
||||
... except MultipleInvalid as e:
|
||||
... print([str(i) for i in e.errors]) # doctest: +NORMALIZE_WHITESPACE
|
||||
['expected a list @ data[0]',
|
||||
'expected a list @ data[1]',
|
||||
'expected a list @ data[2]']
|
||||
|
||||
Required fields in dictionary which are invalid should not have required :
|
||||
|
||||
>>> from voluptuous import *
|
||||
>>> schema = Schema({'one': {'two': 3}}, required=True)
|
||||
>>> try:
|
||||
... schema({'one': {'two': 2}})
|
||||
... except MultipleInvalid as e:
|
||||
... errors = e.errors
|
||||
>>> 'required' in ' '.join([x.msg for x in errors])
|
||||
False
|
||||
|
||||
Multiple errors for nested fields in dicts and objects:
|
||||
|
||||
> \>\>\> from collections import namedtuple \>\>\> validate = Schema({
|
||||
> ... 'anobject': Object({ ... 'strfield': str, ... 'intfield': int ...
|
||||
> }) ... }) \>\>\> try: ... SomeObj = namedtuple('SomeObj', ('strfield',
|
||||
> 'intfield')) ... validate({'anobject': SomeObj(strfield=123,
|
||||
> intfield='one')}) ... except MultipleInvalid as e: ...
|
||||
> print(sorted(str(i) for i in e.errors)) \# doctest:
|
||||
> +NORMALIZE\_WHITESPACE ["expected int for object value @
|
||||
> data['anobject']['intfield']", "expected str for object value @
|
||||
> data['anobject']['strfield']"]
|
||||
|
||||
Custom classes validate as schemas:
|
||||
|
||||
>>> class Thing(object):
|
||||
... pass
|
||||
>>> schema = Schema(Thing)
|
||||
>>> t = schema(Thing())
|
||||
>>> type(t) is Thing
|
||||
True
|
||||
|
||||
Classes with custom metaclasses should validate as schemas:
|
||||
|
||||
>>> class MyMeta(type):
|
||||
... pass
|
||||
>>> class Thing(object):
|
||||
... __metaclass__ = MyMeta
|
||||
>>> schema = Schema(Thing)
|
||||
>>> t = schema(Thing())
|
||||
>>> type(t) is Thing
|
||||
True
|
||||
|
||||
Schemas built with All() should give the same error as the original
|
||||
validator (Issue \#26):
|
||||
|
||||
>>> schema = Schema({
|
||||
... Required('items'): All([{
|
||||
... Required('foo'): str
|
||||
... }])
|
||||
... })
|
||||
|
||||
>>> try:
|
||||
... schema({'items': [{}]})
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"required key not provided @ data['items'][0]['foo']"
|
||||
|
||||
Validator should return same instance of the same type for object:
|
||||
|
||||
>>> class Structure(object):
|
||||
... def __init__(self, q=None):
|
||||
... self.q = q
|
||||
... def __repr__(self):
|
||||
... return '{0.__name__}(q={1.q!r})'.format(type(self), self)
|
||||
...
|
||||
>>> schema = Schema(Object({'q': 'one'}, cls=Structure))
|
||||
>>> type(schema(Structure(q='one'))) is Structure
|
||||
True
|
||||
|
||||
Object validator should treat cls argument as optional. In this case it
|
||||
shouldn't check object type:
|
||||
|
||||
>>> from collections import namedtuple
|
||||
>>> NamedTuple = namedtuple('NamedTuple', ('q',))
|
||||
>>> schema = Schema(Object({'q': 'one'}))
|
||||
>>> named = NamedTuple(q='one')
|
||||
>>> schema(named) == named
|
||||
True
|
||||
>>> schema(named)
|
||||
NamedTuple(q='one')
|
||||
|
||||
If cls argument passed to object validator we should check object type:
|
||||
|
||||
>>> schema = Schema(Object({'q': 'one'}, cls=Structure))
|
||||
>>> schema(NamedTuple(q='one')) # doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
MultipleInvalid: expected a <class 'Structure'>
|
||||
>>> schema = Schema(Object({'q': 'one'}, cls=NamedTuple))
|
||||
>>> schema(NamedTuple(q='one'))
|
||||
NamedTuple(q='one')
|
||||
|
||||
Ensure that objects with \_\_slots\_\_ supported properly:
|
||||
|
||||
>>> class SlotsStructure(Structure):
|
||||
... __slots__ = ['q']
|
||||
...
|
||||
>>> schema = Schema(Object({'q': 'one'}))
|
||||
>>> schema(SlotsStructure(q='one'))
|
||||
SlotsStructure(q='one')
|
||||
>>> class DictStructure(object):
|
||||
... __slots__ = ['q', '__dict__']
|
||||
... def __init__(self, q=None, page=None):
|
||||
... self.q = q
|
||||
... self.page = page
|
||||
... def __repr__(self):
|
||||
... return '{0.__name__}(q={1.q!r}, page={1.page!r})'.format(type(self), self)
|
||||
...
|
||||
>>> structure = DictStructure(q='one')
|
||||
>>> structure.page = 1
|
||||
>>> try:
|
||||
... schema(structure)
|
||||
... raise AssertionError('MultipleInvalid not raised')
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> str(exc)
|
||||
"extra keys not allowed @ data['page']"
|
||||
|
||||
>>> schema = Schema(Object({'q': 'one', Extra: object}))
|
||||
>>> schema(structure)
|
||||
DictStructure(q='one', page=1)
|
||||
|
||||
Ensure that objects can be used with other validators:
|
||||
|
||||
>>> schema = Schema({'meta': Object({'q': 'one'})})
|
||||
>>> schema({'meta': Structure(q='one')})
|
||||
{'meta': Structure(q='one')}
|
||||
|
||||
Ensure that subclasses of Invalid of are raised as is.
|
||||
|
||||
>>> class SpecialInvalid(Invalid):
|
||||
... pass
|
||||
...
|
||||
>>> def custom_validator(value):
|
||||
... raise SpecialInvalid('boom')
|
||||
...
|
||||
>>> schema = Schema({'thing': custom_validator})
|
||||
>>> try:
|
||||
... schema({'thing': 'not an int'})
|
||||
... except MultipleInvalid as e:
|
||||
... exc = e
|
||||
>>> exc.errors[0].__class__.__name__
|
||||
'SpecialInvalid'
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1174,6 +1174,71 @@ static struct nsMyTrustedEVInfo myTrustedEVInfos[] = {
|
|||
"drEgUnTwhYdGs/gjGvbCwA==",
|
||||
nullptr
|
||||
},
|
||||
{
|
||||
// CN=Certplus Root CA G1,O=Certplus,C=FR
|
||||
"1.3.6.1.4.1.22234.3.5.3.1",
|
||||
"DocuSign EV OID 1",
|
||||
SEC_OID_UNKNOWN,
|
||||
{ 0x15, 0x2A, 0x40, 0x2B, 0xFC, 0xDF, 0x2C, 0xD5, 0x48, 0x05, 0x4D,
|
||||
0x22, 0x75, 0xB3, 0x9C, 0x7F, 0xCA, 0x3E, 0xC0, 0x97, 0x80, 0x78,
|
||||
0xB0, 0xF0, 0xEA, 0x76, 0xE5, 0x61, 0xA6, 0xC7, 0x43, 0x3E },
|
||||
"MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy"
|
||||
"dHBsdXMgUm9vdCBDQSBHMQ==",
|
||||
"ESBVg+QtPlRWhS2DN7cs3EYR",
|
||||
nullptr
|
||||
},
|
||||
{
|
||||
// CN=Certplus Root CA G2,O=Certplus,C=FR
|
||||
"1.3.6.1.4.1.22234.3.5.3.2",
|
||||
"DocuSign EV OID 2",
|
||||
SEC_OID_UNKNOWN,
|
||||
{ 0x6C, 0xC0, 0x50, 0x41, 0xE6, 0x44, 0x5E, 0x74, 0x69, 0x6C, 0x4C,
|
||||
0xFB, 0xC9, 0xF8, 0x0F, 0x54, 0x3B, 0x7E, 0xAB, 0xBB, 0x44, 0xB4,
|
||||
0xCE, 0x6F, 0x78, 0x7C, 0x6A, 0x99, 0x71, 0xC4, 0x2F, 0x17 },
|
||||
"MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy"
|
||||
"dHBsdXMgUm9vdCBDQSBHMg==",
|
||||
"ESDZkc6uo+jF5//pAq/Pc7xV",
|
||||
nullptr
|
||||
},
|
||||
{
|
||||
// CN=OpenTrust Root CA G1,O=OpenTrust,C=FR
|
||||
"1.3.6.1.4.1.22234.2.14.3.11",
|
||||
"DocuSign EV OID 3",
|
||||
SEC_OID_UNKNOWN,
|
||||
{ 0x56, 0xC7, 0x71, 0x28, 0xD9, 0x8C, 0x18, 0xD9, 0x1B, 0x4C, 0xFD,
|
||||
0xFF, 0xBC, 0x25, 0xEE, 0x91, 0x03, 0xD4, 0x75, 0x8E, 0xA2, 0xAB,
|
||||
0xAD, 0x82, 0x6A, 0x90, 0xF3, 0x45, 0x7D, 0x46, 0x0E, 0xB4 },
|
||||
"MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w"
|
||||
"ZW5UcnVzdCBSb290IENBIEcx",
|
||||
"ESCzkFU5fX82bWTCp59rY45n",
|
||||
nullptr
|
||||
},
|
||||
{
|
||||
// CN=OpenTrust Root CA G2,O=OpenTrust,C=FR
|
||||
"1.3.6.1.4.1.22234.2.14.3.11",
|
||||
"DocuSign EV OID 3",
|
||||
SEC_OID_UNKNOWN,
|
||||
{ 0x27, 0x99, 0x58, 0x29, 0xFE, 0x6A, 0x75, 0x15, 0xC1, 0xBF, 0xE8,
|
||||
0x48, 0xF9, 0xC4, 0x76, 0x1D, 0xB1, 0x6C, 0x22, 0x59, 0x29, 0x25,
|
||||
0x7B, 0xF4, 0x0D, 0x08, 0x94, 0xF2, 0x9E, 0xA8, 0xBA, 0xF2 },
|
||||
"MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w"
|
||||
"ZW5UcnVzdCBSb290IENBIEcy",
|
||||
"ESChaRu/vbm9UpaPI+hIvyYR",
|
||||
nullptr
|
||||
},
|
||||
{
|
||||
// CN=OpenTrust Root CA G3,O=OpenTrust,C=FR
|
||||
"1.3.6.1.4.1.22234.2.14.3.11",
|
||||
"DocuSign EV OID 3",
|
||||
SEC_OID_UNKNOWN,
|
||||
{ 0xB7, 0xC3, 0x62, 0x31, 0x70, 0x6E, 0x81, 0x07, 0x8C, 0x36, 0x7C,
|
||||
0xB8, 0x96, 0x19, 0x8F, 0x1E, 0x32, 0x08, 0xDD, 0x92, 0x69, 0x49,
|
||||
0xDD, 0x8F, 0x57, 0x09, 0xA4, 0x10, 0xF7, 0x5B, 0x62, 0x92 },
|
||||
"MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w"
|
||||
"ZW5UcnVzdCBSb290IENBIEcz",
|
||||
"ESDm+Ez8JLC+BUCs2oMbNGA/",
|
||||
nullptr
|
||||
},
|
||||
};
|
||||
|
||||
static SECOidTag
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
implementation: taskgraph.task.test:TestTask
|
||||
|
||||
kind-dependencies:
|
||||
- legacy
|
||||
|
||||
transforms:
|
||||
- taskgraph.transforms.tests.test_description:validate
|
||||
- taskgraph.transforms.tests.android_test:transforms
|
||||
- taskgraph.transforms.tests.all_kinds:transforms
|
||||
- taskgraph.transforms.tests.test_description:validate
|
||||
- taskgraph.transforms.tests.make_task_description:transforms
|
||||
- taskgraph.transforms.make_task:transforms
|
|
@ -0,0 +1,19 @@
|
|||
# This file maps build platforms to test platforms. In some cases, a
|
||||
# single build may be tested on multiple test platforms, but a single test
|
||||
# platform can only link to one build platform. Both build and test platforms
|
||||
# are represented as <platform>/<type>, where <type> is what Treeherder calls a
|
||||
# collection.
|
||||
#
|
||||
# Each test platform further specifies the set of tests that will be scheduled
|
||||
# for the platform, referring to tests defined in test-sets.yml.
|
||||
#
|
||||
# Note that set does not depend on the tree; tree-dependent job selection
|
||||
# should be performed in the target task selection phase of task-graph
|
||||
# generation.
|
||||
|
||||
android-4.3-arm7-api-15/debug:
|
||||
build-platform: android-api-15/debug
|
||||
test-set: debug-tests
|
||||
android-4.3-arm7-api-15/opt:
|
||||
build-platform: android-api-15/opt
|
||||
test-set: opt-tests
|
|
@ -0,0 +1,37 @@
|
|||
# Each key in this file specifies a set of tests to run. Different test sets
|
||||
# may, for example, be bound to different test platforms.
|
||||
#
|
||||
# Note that set does not depend on the tree; tree-dependent job selection
|
||||
# should be performed in the target task selection phase of task-graph
|
||||
# generation.
|
||||
#
|
||||
# A test set has a name, and a list of tests that it contains.
|
||||
#
|
||||
# Test names given here reference tests.yml.
|
||||
|
||||
debug-tests:
|
||||
- cppunit
|
||||
- crashtest
|
||||
- jsreftest
|
||||
- mochitest
|
||||
- mochitest-chrome
|
||||
- mochitest-clipboard
|
||||
- mochitest-gpu
|
||||
- mochitest-media
|
||||
- mochitest-webgl
|
||||
- reftest
|
||||
- xpcshell
|
||||
|
||||
opt-tests:
|
||||
- cppunit
|
||||
- crashtest
|
||||
- jsreftest
|
||||
- mochitest
|
||||
- mochitest-chrome
|
||||
- mochitest-clipboard
|
||||
- mochitest-gpu
|
||||
- mochitest-media
|
||||
- mochitest-webgl
|
||||
- reftest
|
||||
- robocop
|
||||
- xpcshell
|
|
@ -0,0 +1,248 @@
|
|||
# Each stanza here describes a particular test suite or sub-suite. These are
|
||||
# processed through the transformations described in kind.yml to produce a
|
||||
# bunch of tasks. See the schema in `test-descriptions.py` for a description
|
||||
# of the fields used here.
|
||||
|
||||
# The Android tests have separate test definitions from desktop because,
|
||||
# despite sharing test names, the invocation of these test suites differ
|
||||
# substantially from desktop.
|
||||
|
||||
# Note that these are in lexical order
|
||||
|
||||
cppunit:
|
||||
description: "CPP Unit Tests"
|
||||
suite: cppunittest
|
||||
treeherder-symbol: tc(Cpp)
|
||||
e10s: false
|
||||
loopback-video: true
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=cppunittest
|
||||
|
||||
crashtest:
|
||||
description: "Crashtest run"
|
||||
suite: crashtest
|
||||
treeherder-symbol: tc-R(C)
|
||||
instance-size: xlarge
|
||||
chunks:
|
||||
by-test-platform:
|
||||
android-4.3-arm7-api-15/debug: 10
|
||||
android-4.3-arm7-api-15/opt: 4
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=crashtest
|
||||
|
||||
jsreftest:
|
||||
description: "JS Reftest run"
|
||||
suite: reftest/jsreftest
|
||||
treeherder-symbol: tc-R(J)
|
||||
instance-size: xlarge
|
||||
chunks:
|
||||
by-test-platform:
|
||||
android-4.3-arm7-api-15/debug: 20
|
||||
android-4.3-arm7-api-15/opt: 6
|
||||
loopback-video: true
|
||||
max-run-time: 7200
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=jsreftest
|
||||
|
||||
mochitest:
|
||||
description: "Mochitest plain run"
|
||||
suite: mochitest/plain-chunked
|
||||
treeherder-symbol: tc-M()
|
||||
instance-size: xlarge
|
||||
chunks: 20
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
max-run-time:
|
||||
by-test-platform:
|
||||
android-4.3-arm7-api-15/debug: 10800
|
||||
android-4.3-arm7-api-15/opt: 3600
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=mochitest
|
||||
|
||||
mochitest-chrome:
|
||||
description: "Mochitest chrome run"
|
||||
suite: mochitest/chrome
|
||||
treeherder-symbol: tc-M(c)
|
||||
instance-size: xlarge
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
max-run-time: 5400
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=mochitest-chrome
|
||||
|
||||
mochitest-clipboard:
|
||||
description: "Mochitest clipboard run"
|
||||
suite: mochitest/plain-clipboard
|
||||
treeherder-symbol: tc-M(cl)
|
||||
instance-size: xlarge
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=mochitest-plain-clipboard
|
||||
|
||||
mochitest-gpu:
|
||||
description: "Mochitest gpu run"
|
||||
suite: mochitest/plain-gpu
|
||||
treeherder-symbol: tc-M(gpu)
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=mochitest-plain-gpu
|
||||
|
||||
mochitest-media:
|
||||
description: "Mochitest media run"
|
||||
suite: mochitest/mochitest-media
|
||||
treeherder-symbol: tc-M(mda)
|
||||
instance-size: xlarge
|
||||
chunks: 2
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
max-run-time:
|
||||
by-test-platform:
|
||||
android-4.3-arm7-api-15/debug: 5400
|
||||
android-4.3-arm7-api-15/opt: 3600
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=mochitest-media
|
||||
|
||||
mochitest-webgl:
|
||||
description: "Mochitest webgl run"
|
||||
suite: mochitest/mochitest-gl
|
||||
treeherder-symbol: tc-M(gl)
|
||||
chunks: 10
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
max-run-time: 7200
|
||||
instance-size:
|
||||
by-test-platform:
|
||||
android-4.3-arm7-api-15/opt: default
|
||||
android-4.3-arm7-api-15/debug: xlarge
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=mochitest-gl
|
||||
|
||||
reftest:
|
||||
description: "Reftest run"
|
||||
suite: reftest/reftest
|
||||
treeherder-symbol: tc-R(R)
|
||||
chunks:
|
||||
by-test-platform:
|
||||
android-4.3-arm7-api-15/debug: 48
|
||||
android-4.3-arm7-api-15/opt: 16
|
||||
instance-size: xlarge
|
||||
max-run-time: 10800
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=reftest
|
||||
|
||||
robocop:
|
||||
description: "Robocop run"
|
||||
suite: robocop
|
||||
treeherder-symbol: tc-M(rc)
|
||||
instance-size: xlarge
|
||||
chunks:
|
||||
by-test-platform:
|
||||
# android-4.3-arm7-api-15/debug -- not run
|
||||
android-4.3-arm7-api-15/opt: 4
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=robocop
|
||||
|
||||
xpcshell:
|
||||
description: "xpcshell test run"
|
||||
suite: xpcshell
|
||||
treeherder-symbol: tc-X()
|
||||
chunks: 3
|
||||
instance-size: xlarge
|
||||
max-run-time: 7200
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/android_emulator_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/android/androidarm_4_3.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
- mozharness/configs/android/androidarm_4_3-tc.py
|
||||
extra-options:
|
||||
- --test-suite=xpcshell
|
|
@ -0,0 +1,12 @@
|
|||
implementation: taskgraph.task.test:TestTask
|
||||
|
||||
kind-dependencies:
|
||||
- legacy
|
||||
|
||||
transforms:
|
||||
- taskgraph.transforms.tests.test_description:validate
|
||||
- taskgraph.transforms.tests.desktop_test:transforms
|
||||
- taskgraph.transforms.tests.all_kinds:transforms
|
||||
- taskgraph.transforms.tests.test_description:validate
|
||||
- taskgraph.transforms.tests.make_task_description:transforms
|
||||
- taskgraph.transforms.make_task:transforms
|
|
@ -0,0 +1,27 @@
|
|||
# This file maps build platforms to test platforms. In some cases, a
|
||||
# single build may be tested on multiple test platforms, but a single test
|
||||
# platform can only link to one build platform. Both build and test platforms
|
||||
# are represented as <platform>/<type>, where <type> is what Treeherder calls a
|
||||
# collection.
|
||||
#
|
||||
# Each test platform further specifies the set of tests that will be scheduled
|
||||
# for the platform, referring to tests defined in test-sets.yml.
|
||||
#
|
||||
# Note that set does not depend on the tree; tree-dependent job selection
|
||||
# should be performed in the target task selection phase of task-graph
|
||||
# generation.
|
||||
|
||||
linux64/debug:
|
||||
build-platform: linux64/debug
|
||||
test-set: all-tests
|
||||
linux64/opt:
|
||||
build-platform: linux64/opt
|
||||
test-set: all-tests
|
||||
|
||||
# TODO: use 'pgo' and 'asan' labels here, instead of -pgo/opt
|
||||
linux64-pgo/opt:
|
||||
build-platform: linux64-pgo/opt
|
||||
test-set: all-tests
|
||||
linux64-asan/opt:
|
||||
build-platform: linux64-asan/opt
|
||||
test-set: asan-tests
|
|
@ -0,0 +1,54 @@
|
|||
# Each key in this file specifies a set of tests to run. Different test sets
|
||||
# may, for example, be bound to different test platforms.
|
||||
#
|
||||
# Note that set does not depend on the tree; tree-dependent job selection
|
||||
# should be performed in the target task selection phase of task-graph
|
||||
# generation.
|
||||
#
|
||||
# A test set has a name, and a list of tests that it contains.
|
||||
#
|
||||
# Test names given here reference tests.yml.
|
||||
|
||||
all-tests:
|
||||
- cppunit
|
||||
- crashtest
|
||||
- external-media-tests
|
||||
- firefox-ui-functional-local
|
||||
- firefox-ui-functional-remote
|
||||
- gtest
|
||||
- jittests
|
||||
- jsreftest
|
||||
- marionette
|
||||
- mochitest
|
||||
- mochitest-a11y
|
||||
- mochitest-browser-chrome
|
||||
- mochitest-chrome
|
||||
- mochitest-clipboard
|
||||
- mochitest-devtools-chrome
|
||||
- mochitest-gpu
|
||||
- mochitest-jetpack
|
||||
- mochitest-media
|
||||
- mochitest-webgl
|
||||
- reftest
|
||||
- reftest-no-accel
|
||||
- web-platform-tests
|
||||
- web-platform-tests-reftests
|
||||
- xpcshell
|
||||
|
||||
asan-tests:
|
||||
- cppunit
|
||||
- crashtest
|
||||
- gtest
|
||||
- jittests
|
||||
- jsreftest
|
||||
- marionette
|
||||
- mochitest
|
||||
- mochitest-browser-chrome
|
||||
- mochitest-chrome
|
||||
- mochitest-clipboard
|
||||
- mochitest-devtools-chrome
|
||||
- mochitest-gpu
|
||||
- mochitest-jetpack
|
||||
- mochitest-media
|
||||
- mochitest-webgl
|
||||
- xpcshell
|
|
@ -0,0 +1,378 @@
|
|||
# Each stanza here describes a particular test suite or sub-suite. These are
|
||||
# processed through the transformations described in kind.yml to produce a
|
||||
# bunch of tasks. See the schema in `test-descriptions.py` for a description
|
||||
# of the fields used here.
|
||||
|
||||
# Note that these are in lexical order
|
||||
|
||||
cppunit:
|
||||
description: "CPP Unit Tests"
|
||||
suite: cppunittest
|
||||
treeherder-symbol: tc(Cpp)
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --cppunittest-suite=cppunittest
|
||||
|
||||
crashtest:
|
||||
description: "Crashtest run"
|
||||
suite: reftest/crashtest
|
||||
treeherder-symbol: tc-R(C)
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
chunked: true
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --reftest-suite=crashtest
|
||||
|
||||
external-media-tests:
|
||||
description: "External Media Test run"
|
||||
suite: external-media-tests
|
||||
treeherder-symbol: tc-VP(b-m)
|
||||
e10s: false
|
||||
tier: 2
|
||||
max-run-time: 5400
|
||||
mozharness:
|
||||
script: mozharness/scripts/firefox_media_tests_buildbot.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/mediatests/buildbot_posix_config.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
|
||||
firefox-ui-functional-local:
|
||||
description: "Firefox-ui-tests functional run"
|
||||
suite: "firefox-ui/functional local"
|
||||
treeherder-symbol: tc-Fxfn-l(en-US)
|
||||
max-run-time: 5400
|
||||
tier: 1
|
||||
mozharness:
|
||||
script: mozharness/scripts/firefox_ui_tests/functional.py
|
||||
config:
|
||||
- mozharness/configs/firefox_ui_tests/taskcluster.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- "--tag local"
|
||||
|
||||
firefox-ui-functional-remote:
|
||||
description: "Firefox-ui-tests functional run"
|
||||
suite: "firefox-ui/functional remote"
|
||||
treeherder-symbol: tc-Fxfn-r(en-US)
|
||||
max-run-time: 5400
|
||||
tier: 2
|
||||
mozharness:
|
||||
script: mozharness/scripts/firefox_ui_tests/functional.py
|
||||
config:
|
||||
- mozharness/configs/firefox_ui_tests/taskcluster.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- "--tag remote"
|
||||
|
||||
gtest:
|
||||
description: "GTests run"
|
||||
suite: gtest
|
||||
treeherder-symbol: tc(GTest)
|
||||
e10s: false
|
||||
instance-size: xlarge
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --gtest-suite=gtest
|
||||
|
||||
jittests:
|
||||
description: "JIT Test run"
|
||||
suite: jittest/jittest-chunked
|
||||
treeherder-symbol: tc(Jit)
|
||||
e10s: false
|
||||
chunks: 6
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --jittest-suite=jittest-chunked
|
||||
|
||||
jsreftest:
|
||||
description: "JS Reftest run"
|
||||
suite: reftest/jsreftest
|
||||
treeherder-symbol: tc-R(J)
|
||||
chunks: 2
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --reftest-suite=jsreftest
|
||||
|
||||
marionette:
|
||||
description: "Marionette unittest run"
|
||||
suite: marionette
|
||||
treeherder-symbol: tc(Mn)
|
||||
max-run-time: 5400
|
||||
mozharness:
|
||||
script: mozharness/scripts/marionette.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/marionette/prod_config.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
|
||||
mochitest:
|
||||
description: "Mochitest plain run"
|
||||
suite: mochitest/plain-chunked
|
||||
treeherder-symbol: tc-M()
|
||||
loopback-video: true
|
||||
chunks: 10
|
||||
max-run-time: 5400
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=plain-chunked
|
||||
|
||||
mochitest-a11y:
|
||||
description: "Mochitest a11y run"
|
||||
suite: mochitest/a11y
|
||||
treeherder-symbol: tc-M(a11y)
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=a11y
|
||||
|
||||
mochitest-browser-chrome:
|
||||
description: "Mochitest browser-chrome run"
|
||||
suite: mochitest/browser-chrome-chunked
|
||||
treeherder-symbol: tc-M(bc)
|
||||
loopback-video: true
|
||||
chunks: 7
|
||||
max-run-time:
|
||||
by-test-platform:
|
||||
linux64/debug: 5400
|
||||
default: 3600
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=browser-chrome-chunked
|
||||
|
||||
mochitest-chrome:
|
||||
description: "Mochitest chrome run"
|
||||
suite: mochitest/chrome
|
||||
treeherder-symbol: tc-M(c)
|
||||
loopback-video: true
|
||||
chunks: 3
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=chrome
|
||||
|
||||
mochitest-clipboard:
|
||||
description: "Mochitest clipboard run"
|
||||
suite: mochitest/plain-clipboard,chrome-clipboard,browser-chrome-clipboard,jetpack-package-clipboard
|
||||
treeherder-symbol: tc-M(cl)
|
||||
loopback-video: true
|
||||
instance-size: xlarge
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=plain-clipboard,chrome-clipboard,browser-chrome-clipboard,jetpack-package-clipboard
|
||||
|
||||
mochitest-devtools-chrome:
|
||||
description: "Mochitest devtools-chrome run"
|
||||
suite: mochitest/mochitest-devtools-chrome-chunked
|
||||
treeherder-symbol: tc-M(dt)
|
||||
loopback-video: true
|
||||
max-run-time: 5400
|
||||
chunks: 10
|
||||
e10s:
|
||||
by-test-platform:
|
||||
# Bug 1242986: linux64/debug mochitest-devtools-chrome e10s is not greened up yet
|
||||
linux64/debug: false
|
||||
default: both
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=mochitest-devtools-chrome-chunked
|
||||
|
||||
mochitest-gpu:
|
||||
description: "Mochitest GPU run"
|
||||
suite: mochitest/plain-gpu,chrome-gpu,browser-chrome-gpu
|
||||
treeherder-symbol: tc-M(gpu)
|
||||
loopback-video: true
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=plain-gpu,chrome-gpu,browser-chrome-gpu
|
||||
|
||||
mochitest-jetpack:
|
||||
description: "Mochitest jetpack run"
|
||||
suite: mochitest/jetpack-package
|
||||
treeherder-symbol: tc-M(JP)
|
||||
loopback-video: true
|
||||
e10s: false
|
||||
max-run-time: 5400
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=jetpack-package
|
||||
|
||||
mochitest-media:
|
||||
description: "Mochitest media run"
|
||||
suite: mochitest/mochitest-media
|
||||
treeherder-symbol: tc-M(mda)
|
||||
max-run-time: 5400
|
||||
loopback-video: true
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=mochitest-media
|
||||
|
||||
mochitest-webgl:
|
||||
description: "Mochitest webgl run"
|
||||
suite: mochitest/mochitest-gl
|
||||
treeherder-symbol: tc-M(gl)
|
||||
loopback-video: true
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
chunked: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --mochitest-suite=mochitest-gl
|
||||
|
||||
reftest:
|
||||
description: "Reftest run"
|
||||
suite: reftest/reftest
|
||||
treeherder-symbol: tc-R(R)
|
||||
chunks: 8
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --reftest-suite=reftest
|
||||
|
||||
reftest-no-accel:
|
||||
description: "Reftest not accelerated run"
|
||||
suite: reftest/reftest-no-accel
|
||||
treeherder-symbol: tc-R(Ru)
|
||||
chunks: 8
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --reftest-suite=reftest-no-accel
|
||||
|
||||
web-platform-tests:
|
||||
description: "Web platform test run"
|
||||
suite: web-platform-tests
|
||||
treeherder-symbol: tc-W()
|
||||
chunks: 12
|
||||
max-run-time: 7200
|
||||
instance-size: xlarge
|
||||
mozharness:
|
||||
script: mozharness/scripts/web_platform_tests.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/web_platform_tests/prod_config.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --test-type=testharness
|
||||
|
||||
web-platform-tests-reftests:
|
||||
description: "Web platform reftest run"
|
||||
suite: web-platform-tests-reftests
|
||||
treeherder-symbol: tc-W(Wr)
|
||||
max-run-time: 5400
|
||||
instance-size: xlarge
|
||||
mozharness:
|
||||
script: mozharness/scripts/web_platform_tests.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/web_platform_tests/prod_config.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --test-type=reftest
|
||||
|
||||
xpcshell:
|
||||
description: "xpcshell test run"
|
||||
suite: xpcshell
|
||||
treeherder-symbol: tc-X()
|
||||
chunks:
|
||||
by-test-platform:
|
||||
linux64/debug: 10
|
||||
default: 8
|
||||
max-run-time: 5400
|
||||
e10s: false
|
||||
mozharness:
|
||||
script: mozharness/scripts/desktop_unittest.py
|
||||
no-read-buildbot-config: true
|
||||
config:
|
||||
- mozharness/configs/unittests/linux_unittest.py
|
||||
- mozharness/configs/remove_executables.py
|
||||
extra-options:
|
||||
- --xpcshell-suite=xpcshell
|
|
@ -2,7 +2,7 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
implementation: 'taskgraph.kind.docker_image:DockerImageTask'
|
||||
implementation: 'taskgraph.task.docker_image:DockerImageTask'
|
||||
images_path: '../../../testing/docker'
|
||||
|
||||
# make a task for each docker-image we might want. For the moment, since we
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
implementation: 'taskgraph.kind.legacy:LegacyTask'
|
||||
implementation: 'taskgraph.task.legacy:LegacyTask'
|
||||
legacy_path: '.'
|
||||
|
|
|
@ -12,10 +12,3 @@ builds:
|
|||
types:
|
||||
opt:
|
||||
task: tasks/builds/mulet_linux.yml
|
||||
|
||||
tests:
|
||||
mochitest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_mochitests.yml
|
||||
chunks: 5
|
||||
|
|
|
@ -28,137 +28,3 @@ builds:
|
|||
types:
|
||||
opt:
|
||||
task: tasks/builds/opt_linux64_pgo.yml
|
||||
|
||||
tests:
|
||||
crashtest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_opt.yml
|
||||
jsreftest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_opt.yml
|
||||
marionette-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_opt.yml
|
||||
mochitest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_opt.yml
|
||||
mochitest-browser-chrome-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_opt.yml
|
||||
mochitest-clipboard-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_opt.yml
|
||||
mochitest-devtools-chrome-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_opt.yml
|
||||
mochitest-gpu-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_opt.yml
|
||||
mochitest-media-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_opt.yml
|
||||
mochitest-webgl-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_opt.yml
|
||||
reftest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_e10s_opt.yml
|
||||
reftest-no-accel-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_e10s_opt.yml
|
||||
web-platform-tests-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_e10s_opt.yml
|
||||
web-platform-tests-reftests-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_e10s_opt.yml
|
||||
|
|
|
@ -40,12 +40,6 @@ flags:
|
|||
- firefox-ui-functional-local-e10s
|
||||
- firefox-ui-functional-remote
|
||||
- firefox-ui-functional-remote-e10s
|
||||
- gaia-build
|
||||
- gaia-build-unit
|
||||
- gaia-js-integration
|
||||
- gaia-linter
|
||||
- gaia-unit
|
||||
- gaia-unit-oop
|
||||
- gtest
|
||||
- jittests
|
||||
- jsreftest
|
||||
|
|
|
@ -238,470 +238,6 @@ builds:
|
|||
debug:
|
||||
task: tasks/builds/dbg_win64.yml
|
||||
|
||||
tests:
|
||||
cppunit:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_cppunit_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_cppunit_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_cppunit_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_cppunit_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_cppunit_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_cppunit_dbg.yml
|
||||
crashtest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_crashtest_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_crashtest_dbg.yml
|
||||
crashtest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_crashtest_e10s_opt.yml
|
||||
external-media-tests:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_external_media_tests_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_external_media_tests_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_external_media_tests_opt.yml
|
||||
firefox-ui-functional-local:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_local_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_local_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_local_opt.yml
|
||||
firefox-ui-functional-local-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_local_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_local_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_local_e10s_opt.yml
|
||||
firefox-ui-functional-remote:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_remote_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_remote_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_remote_opt.yml
|
||||
firefox-ui-functional-remote-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_remote_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_remote_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_fxui_functional_remote_e10s_opt.yml
|
||||
gaia-build:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_build_test.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_build_test.yml
|
||||
gaia-build-unit:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_build_unit.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_build_unit.yml
|
||||
gaia-js-integration:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_gaia_js_integration_tests.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_gaia_js_integration_tests.yml
|
||||
gaia-linter:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_linter.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_linter.yml
|
||||
gaia-unit:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_gaia_unit.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_gaia_unit.yml
|
||||
gaia-unit-oop:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_gaia_unit_oop.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_gaia_unit_oop.yml
|
||||
gtest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_gtest_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_gtest_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_gtest_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_gtest_opt.yml
|
||||
jittests:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jittests_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jittests_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_jittests_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_jittests_opt.yml
|
||||
jsreftest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_jsreftest_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_jsreftest_dbg.yml
|
||||
jsreftest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_jsreftest_e10s_opt.yml
|
||||
marionette:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_opt.yml
|
||||
marionette-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_marionette_e10s_opt.yml
|
||||
mochitest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_mochitests.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_mochitests.yml
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_plain_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_plain_dbg.yml
|
||||
mochitest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_plain_e10s_opt.yml
|
||||
mochitest-a11y:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_a11y_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_a11y_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_a11y_opt.yml
|
||||
mochitest-browser-chrome:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_opt.yml
|
||||
mochitest-browser-chrome-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_bc_e10s_opt.yml
|
||||
mochitest-chrome:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_chrome_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_chrome_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_chrome_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_chrome_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_chrome_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_chrome_dbg.yml
|
||||
mochitest-devtools-chrome:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_opt.yml
|
||||
mochitest-devtools-chrome-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_opt.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_dt_e10s_opt.yml
|
||||
mochitest-jetpack:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_jetpack_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_jetpack_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_jetpack_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_jetpack_opt.yml
|
||||
mochitest-media:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_media_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_media_dbg.yml
|
||||
mochitest-media-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_media_e10s_opt.yml
|
||||
mochitest-webgl:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_gl_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_gl_dbg.yml
|
||||
mochitest-webgl-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gl_e10s_opt.yml
|
||||
mochitest-gpu:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_gpu_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_gpu_dbg.yml
|
||||
mochitest-gpu-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_gpu_e10s_opt.yml
|
||||
mochitest-clipboard:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_clipboard_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_mochitest_clipboard_dbg.yml
|
||||
mochitest-clipboard-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_mochitest_clipboard_e10s_opt.yml
|
||||
reftest:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_reftests.yml
|
||||
tasks/builds/mulet_linux_dbg.yml:
|
||||
task: tasks/tests/mulet_reftests.yml
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_reftest_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_reftest_dbg.yml
|
||||
reftest-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_e10s_opt.yml
|
||||
reftest-no-accel:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_opt.yml
|
||||
reftest-no-accel-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_reftest_not_accelerated_e10s_opt.yml
|
||||
robocop:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_robocop_opt.yml
|
||||
web-platform-tests:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_opt.yml
|
||||
web-platform-tests-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_e10s_opt.yml
|
||||
web-platform-tests-reftests:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_opt.yml
|
||||
web-platform-tests-reftests-e10s:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_e10s_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_e10s_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_web_platform_tests_reftests_e10s_opt.yml
|
||||
xpcshell:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/opt_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_xpcshell_opt.yml
|
||||
tasks/builds/dbg_linux64.yml:
|
||||
task: tasks/tests/fx_linux64_xpcshell_dbg.yml
|
||||
tasks/builds/opt_linux64_pgo.yml:
|
||||
task: tasks/tests/fx_linux64_xpcshell_opt.yml
|
||||
tasks/builds/opt_linux64-asan.yml:
|
||||
task: tasks/tests/fx_linux64_xpcshell_opt.yml
|
||||
tasks/builds/android_api_15.yml:
|
||||
task: tasks/tests/fx_android-api-15_xpcshell_opt.yml
|
||||
tasks/builds/android_api_15_debug.yml:
|
||||
task: tasks/tests/fx_android-api-15_xpcshell_dbg.yml
|
||||
|
||||
# Miscellaneous tasks.
|
||||
tasks:
|
||||
eslint-gecko:
|
||||
|
|
|
@ -28,32 +28,6 @@ builds:
|
|||
debug:
|
||||
task: tasks/builds/b2g_nexus_5l_debug.yml
|
||||
|
||||
tests:
|
||||
gaia-build:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_build_test.yml
|
||||
gaia-build-unit:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_build_unit.yml
|
||||
gaia-js-integration:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_gaia_js_integration_tests.yml
|
||||
gaia-linter:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_linter.yml
|
||||
gaia-unit:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_gaia_unit.yml
|
||||
gaia-unit-oop:
|
||||
allowed_build_tasks:
|
||||
tasks/builds/mulet_linux.yml:
|
||||
task: tasks/tests/mulet_gaia_unit_oop.yml
|
||||
|
||||
post-build:
|
||||
simulator:
|
||||
allowed_build_tasks:
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/docker_test.yml'
|
||||
task:
|
||||
scopes:
|
||||
- 'docker-worker:cache:level-{{level}}-{{project}}-tc-vcs'
|
||||
- 'docker-worker:cache:level-{{level}}-{{project}}-dotcache'
|
||||
- 'docker-worker:capability:device:loopbackVideo'
|
||||
- 'docker-worker:capability:device:loopbackAudio'
|
||||
payload:
|
||||
cache:
|
||||
# So pip installs are cached...
|
||||
level-{{level}}-{{project}}-dotcache: /home/worker/.cache
|
||||
level-{{level}}-{{project}}-tc-vcs: '/home/worker/.tc-vcs'
|
||||
capabilities:
|
||||
devices:
|
||||
loopbackVideo: true
|
||||
loopbackAudio: true
|
||||
env:
|
||||
NEED_XVFB: true
|
||||
GECKO_HEAD_REPOSITORY: '{{{head_repository}}}'
|
||||
GECKO_HEAD_REV: '{{{head_rev}}}'
|
||||
GAIA_HEAD_REPOSITORY: '{{{gaia_head_repository}}}'
|
||||
GAIA_BASE_REPOSITORY: '{{{gaia_base_repository}}}'
|
||||
GAIA_REF: '{{{gaia_ref}}}'
|
||||
GAIA_REV: '{{{gaia_rev}}}'
|
||||
artifacts:
|
||||
'public/build':
|
||||
type: directory
|
||||
path: '/home/worker/artifacts/'
|
||||
expires:
|
||||
relative-datestamp: '1 year'
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ cppunit test'
|
||||
description: cppunit run
|
||||
extra:
|
||||
suite:
|
||||
name: cppunittest
|
||||
treeherder:
|
||||
groupSymbol: tc
|
||||
symbol: Cpp
|
|
@ -1,9 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_cppunit.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_cppunit.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ crashtest-{{chunk}}'
|
||||
description: Crashtest run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 4
|
||||
suite:
|
||||
name: crashtest-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-R
|
||||
symbol: C{{chunk}}
|
|
@ -1,13 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_crashtest.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
suite:
|
||||
name: crashtest-debug-{{chunk}}
|
||||
chunks:
|
||||
total: 10
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_crashtest.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,34 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_docker_desktop_generic.yml'
|
||||
task:
|
||||
payload:
|
||||
cache:
|
||||
tooltool-cache: '/home/worker/tooltool-cache'
|
||||
capabilities:
|
||||
devices:
|
||||
loopbackVideo: true
|
||||
command:
|
||||
- --no-read-buildbot-config
|
||||
- {"task-reference": "--installer-url=https://queue.taskcluster.net/v1/task/<{{build_slugid}}>/artifacts/{{build_location}}"}
|
||||
- {"task-reference": "--test-packages-url=https://queue.taskcluster.net/v1/task/<{{build_slugid}}>/artifacts/{{test_packages_location}}"}
|
||||
env:
|
||||
MOZHARNESS_SCRIPT: 'mozharness/scripts/android_emulator_unittest.py'
|
||||
MOZHARNESS_CONFIG: >
|
||||
mozharness/configs/android/androidarm_4_3.py
|
||||
mozharness/configs/remove_executables.py
|
||||
mozharness/configs/android/androidarm_4_3-tc.py
|
||||
MOZHARNESS_ACTIONS: 'get-secrets'
|
||||
MOZ_NODE_PATH: None
|
||||
features:
|
||||
relengAPIProxy: true
|
||||
scopes:
|
||||
- 'docker-worker:capability:device:loopbackVideo'
|
||||
- 'docker-worker:cache:tooltool-cache'
|
||||
- 'docker-worker:relengapi-proxy:tooltool.download.internal'
|
||||
- 'docker-worker:relengapi-proxy:tooltool.download.public'
|
||||
extra:
|
||||
treeherder:
|
||||
machine:
|
||||
platform: android-4-3-armv7-api15
|
||||
groupName: Android tests
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
maxRunTime: 7200
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ jsreftest-{{chunk}}'
|
||||
description: jsreftest run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 6
|
||||
suite:
|
||||
name: jsreftest-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-R
|
||||
symbol: J{{chunk}}
|
|
@ -1,13 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_jsreftest.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
suite:
|
||||
name: jsreftest-debug-{{chunk}}
|
||||
chunks:
|
||||
total: 20
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_jsreftest.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,18 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
maxRunTime: 5400
|
||||
command:
|
||||
- --test-suite={{suite}}
|
||||
metadata:
|
||||
name: '[TC] Android API 15 mochitest-chrome'
|
||||
description: Mochitest chrome run
|
||||
extra:
|
||||
suite:
|
||||
name: mochitest-chrome
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: c
|
|
@ -1,9 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_chrome.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_chrome.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,17 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ mochitest-clipboard'
|
||||
description: Mochitest Clipboard run
|
||||
extra:
|
||||
suite:
|
||||
name: mochitest-plain-clipboard
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: cl
|
|
@ -1,9 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_clipboard.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_clipboard.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
payload:
|
||||
maxRunTime: 7200
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ mochitest-gl-{{chunk}}'
|
||||
description: Mochitest WebGL run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 10
|
||||
suite:
|
||||
name: mochitest-gl-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: gl{{chunk}}
|
|
@ -1,10 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_gl.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_gl.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,16 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ mochitest-gpu'
|
||||
description: Mochitest GPU run
|
||||
extra:
|
||||
suite:
|
||||
name: mochitest-plain-gpu
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: gpu
|
|
@ -1,9 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_gpu.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_gpu.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ mochitest-media-{{chunk}}'
|
||||
description: Mochitest Media run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 2
|
||||
suite:
|
||||
name: mochitest-media-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: mda{{chunk}}
|
|
@ -1,10 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_media.yml'
|
||||
task:
|
||||
payload:
|
||||
maxRunTime: 5400
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_media.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ mochitest-{{chunk}}'
|
||||
description: Mochitest plain run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 20
|
||||
suite:
|
||||
name: mochitest-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: {{chunk}}
|
|
@ -1,10 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_plain.yml'
|
||||
task:
|
||||
payload:
|
||||
maxRunTime: 10800
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_mochitest_plain.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
maxRunTime: 10800
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ reftest-{{chunk}}'
|
||||
description: Reftest run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 16
|
||||
suite:
|
||||
name: reftest-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-R
|
||||
symbol: R{{chunk}}
|
|
@ -1,13 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_reftest.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
suite:
|
||||
name: reftest-debug-{{chunk}}
|
||||
chunks:
|
||||
total: 48
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_reftest.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,19 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ robocop-{{chunk}}'
|
||||
description: Robocop run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 4
|
||||
suite:
|
||||
name: robocop-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-M
|
||||
symbol: rc{{chunk}}
|
|
@ -1,9 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_robocop.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_robocop.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,20 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_generic.yml'
|
||||
task:
|
||||
workerType: desktop-test-xlarge
|
||||
payload:
|
||||
maxRunTime: 7200
|
||||
command:
|
||||
- --test-suite={{suite}}{{chunk}}
|
||||
metadata:
|
||||
name: '[TC] Android 4.3 API15+ xpcshell-{{chunk}}'
|
||||
description: XPCShell run {{chunk}}
|
||||
extra:
|
||||
chunks:
|
||||
total: 3
|
||||
suite:
|
||||
name: xpcshell-{{chunk}}
|
||||
treeherder:
|
||||
groupSymbol: tc-X
|
||||
symbol: {{chunk}}
|
|
@ -1,9 +0,0 @@
|
|||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_xpcshell.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=true
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 1
|
|
@ -1,10 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_android-api-15_xpcshell.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --download-symbols=ondemand
|
||||
extra:
|
||||
treeherder:
|
||||
tier: 2
|
|
@ -1,8 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_docker_test_base.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- bash
|
||||
- /home/worker/bin/test.sh
|
|
@ -1,42 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/docker_test.yml'
|
||||
docker-image: desktop-test
|
||||
task:
|
||||
workerType: desktop-test
|
||||
scopes:
|
||||
- docker-worker:cache:level-{{level}}-{{project}}-test-workspace
|
||||
payload:
|
||||
image:
|
||||
type: 'task-image'
|
||||
path: 'public/image.tar'
|
||||
taskId:
|
||||
task-reference: "<docker-image>"
|
||||
|
||||
env:
|
||||
NEED_WINDOW_MANAGER: true
|
||||
NEED_PULSEAUDIO: true
|
||||
GECKO_HEAD_REPOSITORY: '{{{head_repository}}}'
|
||||
GECKO_HEAD_REV: '{{{head_rev}}}'
|
||||
MOZ_NODE_PATH: '/usr/local/bin/node'
|
||||
|
||||
cache:
|
||||
# put the workspace and /tmp on a cache, less for inter-task caching than
|
||||
# to get this directory on fast, non-aufs storage
|
||||
level-{{level}}-{{project}}-test-workspace: '/home/worker/workspace'
|
||||
|
||||
artifacts:
|
||||
'public/test':
|
||||
type: directory
|
||||
path: '/home/worker/artifacts/'
|
||||
expires:
|
||||
relative-datestamp: '1 year'
|
||||
features:
|
||||
allowPtrace: true
|
||||
extra:
|
||||
treeherder:
|
||||
groupName: Desktop tests
|
||||
tier: 1
|
||||
treeherderEnv:
|
||||
- production
|
||||
- staging
|
|
@ -1,25 +0,0 @@
|
|||
---
|
||||
$inherits:
|
||||
from: 'tasks/tests/fx_docker_desktop_generic.yml'
|
||||
task:
|
||||
payload:
|
||||
command:
|
||||
- --no-read-buildbot-config
|
||||
- {"task-reference": "--installer-url=https://queue.taskcluster.net/v1/task/<{{build_slugid}}>/artifacts/{{build_location}}"}
|
||||
- {"task-reference": "--test-packages-url=https://queue.taskcluster.net/v1/task/<{{build_slugid}}>/artifacts/{{test_packages_location}}"}
|
||||
- --cppunittest-suite=cppunittest
|
||||
env:
|
||||
MOZHARNESS_SCRIPT: 'mozharness/scripts/desktop_unittest.py'
|
||||
MOZHARNESS_CONFIG: >
|
||||
mozharness/configs/unittests/linux_unittest.py
|
||||
mozharness/configs/remove_executables.py
|
||||
metadata:
|
||||
name: '[TC] Linux64 cppunit'
|
||||
description: CPP unit tests
|
||||
extra:
|
||||
suite:
|
||||
name: cppunittest
|
||||
flavor: cppunittest
|
||||
treeherder:
|
||||
groupName: Desktop cppunit
|
||||
symbol: Cpp
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче