diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-03-02 12:59:05 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-03-02 12:59:05 -0800 |
commit | 3a83266acee37e99832adaf1337c6b3ab7559f50 (patch) | |
tree | 8700b04028864100e2618a72e4a9f52a6bc2f224 /testing/resources/javascript/globals.in | |
parent | fb3eea5323bf59884659510a6743037cc1d546cd (diff) | |
download | pdfium-3a83266acee37e99832adaf1337c6b3ab7559f50.tar.xz |
Merge to XFA: Return error information from pdfium to JS.
Cherry-pick from b720d0a14601f1496ef15297bc46d401f5a2a890 +
Manually resolve merge conflicts +
Fix more IWYU to fix compile.
Original Review URL: https://codereview.chromium.org/963193003
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/971013002
Diffstat (limited to 'testing/resources/javascript/globals.in')
-rw-r--r-- | testing/resources/javascript/globals.in | 44 |
1 files changed, 33 insertions, 11 deletions
diff --git a/testing/resources/javascript/globals.in b/testing/resources/javascript/globals.in index 6d2f3ca241..4812101e7a 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()); } } } |