Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1316)

Unified Diff: testing/resources/javascript/globals.in

Issue 971013002: Merge to XFA: Return error information from pdfium to JS. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/resources/javascript/globals.in
diff --git a/testing/resources/javascript/globals.in b/testing/resources/javascript/globals.in
index 6d2f3ca2414eb8bd3fceb1f3ff71962157eccf21..4812101e7a27415bc246918e0a422183a149d08d 100644
--- a/testing/resources/javascript/globals.in
+++ b/testing/resources/javascript/globals.in
@@ -63,21 +63,34 @@ var props_to_test = [
function setup_global() {
for (var i = 0; i < props_to_test.length; ++i) {
var prop = props_to_test[i];
- global[prop.name] = prop.value;
+ try {
+ global[prop.name] = prop.value;
+ } catch (e) {
+ app.alert("For " + prop.name + ": Setup: ERROR: " + e.toString());
+ }
}
}
function delete_global() {
for (var i = 0; i < props_to_test.length; ++i) {
var prop = props_to_test[i];
- delete global[prop.name];
+ try {
+ delete global[prop.name];
+ } catch (e) {
+ app.alert("For " + prop.name + ": Delete: ERROR: " + e.toString());
+ }
}
}
function persist_global(should_persist) {
for (var i = 0; i < props_to_test.length; ++i) {
var prop = props_to_test[i];
- global.setPersistent(prop.name, should_persist);
+ try {
+ global.setPersistent(prop.name, should_persist);
+ } catch (e) {
+ app.alert("For " + prop.name +
+ ": Set Persistent: ERROR: " + e.toString());
+ }
}
}
@@ -85,18 +98,27 @@ function dump_global(msg) {
app.alert("************ " + msg + " ************");
app.alert("Enumerable Globals:");
for (var name in global) {
- app.alert(" " + name + " = " + global[name] +
- ", own property = " + global.hasOwnProperty(name));
+ try {
+ app.alert(" " + name + " = " + global[name] +
+ ", own property = " + global.hasOwnProperty(name));
+ } catch (e) {
+ app.alert("For " + name + ": Dump: ERROR: " + e.toString());
+ }
}
app.alert("Expected Globals:");
for (var i = 0; i < props_to_test.length; ++i) {
var prop = props_to_test[i];
- var actual = global[prop.name];
- app.alert(" " + prop.name + " = " + actual);
- if (actual != null && typeof actual == "object") {
- app.alert(" " + actual.colors[0]);
- app.alert(" " + actual.colors[1]);
- app.alert(" " + actual.colors[2]);
+ try {
+ var actual = global[prop.name];
+ app.alert(" " + prop.name + " = " + actual);
+ if (actual != null && typeof actual == "object") {
+ app.alert(" " + actual.colors[0]);
+ app.alert(" " + actual.colors[1]);
+ app.alert(" " + actual.colors[2]);
+ }
+ } catch (e) {
+ app.alert("For " + prop.name +
+ ": Dump Expected: ERROR: " + e.toString());
}
}
}
« no previous file with comments | « testing/resources/javascript/document_props_expected.txt ('k') | testing/resources/javascript/globals_expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698