You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2012/08/20 20:38:03 UTC
ios commit: Remove exec() bridge from CordovaLibApp.
Updated Branches:
refs/heads/master 2a43d7957 -> aa8865981
Remove exec() bridge from CordovaLibApp.
It has been moved to mobile-spec.
Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/aa886598
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/aa886598
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/aa886598
Branch: refs/heads/master
Commit: aa8865981c003cbc0508ffb8c3be1943a32c43c0
Parents: 2a43d79
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Aug 20 14:37:19 2012 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Aug 20 14:37:19 2012 -0400
----------------------------------------------------------------------
CordovaLib/CordovaLibApp/www/index.html | 60 --------------------------
1 files changed, 0 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/aa886598/CordovaLib/CordovaLibApp/www/index.html
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLibApp/www/index.html b/CordovaLib/CordovaLibApp/www/index.html
index bb6955a..f7ffdf0 100644
--- a/CordovaLib/CordovaLibApp/www/index.html
+++ b/CordovaLib/CordovaLibApp/www/index.html
@@ -72,64 +72,6 @@
navigator.notification.alert("Cordova is working")
}
- var appLogElem;
- function appLog(message) {
- if (!appLogElem) {
- appLogElem = document.getElementById('app-logs');
- }
- appLogElem.innerText += message + '\n';
- }
-
- function benchExec()
- {
- appLog('Started exec benchmark');
- var exec = cordova.require('cordova/exec'),
- BENCH_DURATION_MS = 2000,
- BENCH_PAYLOAD = 'This is a small test message.',
- startTime = +new Date,
- callCount = 0;
-
- function win(result) {
- callCount++;
- if (result != BENCH_PAYLOAD) {
- appLog('Wrong echo data!');
- }
- var elapsedMs = new Date - startTime;
- if (elapsedMs < BENCH_DURATION_MS) {
- setTimeout(echoMessage, 0);
- } else {
- var callsPerSecond = callCount * 1000 / elapsedMs;
- appLog('Calls per second: ' + callsPerSecond);
- }
- }
- function fail() {
- appLog('Call failed!');
- }
- function echoMessage() {
- exec(win, fail, "EchoPlugin", "echo", [BENCH_PAYLOAD]);
- }
- echoMessage();
- setTimeout(function() {
- if (!callCount) {
- alert('Echo plugin did not respond');
- }
- }, 500);
-
- // Benchmark results on agrieve's iPad 3:
- // webView:shouldStartLoadWithRequest:navigationType:
- // ~350 Echos per second.
- // NSURLProtocol with XHR to gap:///gapready, not handling response:
- // ~160 Echos per second.
- // NSURLProtocol with XHR to http:///gapready, not handling response:
- // ~215 Echos per second.
- // NSURLProtocol with XHR to file:///gapready, not handling response:
- // ~215 Echos per second.
- // NSURLProtocol with XHR to about:/gapready, not handling response:
- // ~160 Echos per second.
- // NSURLProtocol with XHR to http:///gapready, *with* handling response:
- // ~160 Echos per second.
- }
-
</script>
</head>
<body onload="onBodyLoad()">
@@ -138,7 +80,5 @@
<li>Check your console log for any white-list rejection errors.</li>
<li>Add your allowed <strong>hosts</strong> in Cordova.plist/ExternalHosts (wildcards OK, don't enter the URL scheme)</li>
</ol>
- <button onclick="benchExec()">Benchmark exec</button>
- <pre id="app-logs"></pre>
</body>
</html>