Fixes issue 18015: Avoid network roundtrip in the test
authorIván Perdomo <ivan.perdomo@openbravo.com>
Thu, 28 Jul 2011 12:48:25 +0200
changeset 13321 8ca5a1c79fda
parent 13320 021aea273863
child 13322 1dca0763b990
Fixes issue 18015: Avoid network roundtrip in the test
- Use only Window.create, pure client side performace
- Remove the call to the server on each open tab
modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html
--- a/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html	Thu Jul 28 12:36:33 2011 +0200
+++ b/modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/benchmark/index.html	Thu Jul 28 12:48:25 2011 +0200
@@ -32,36 +32,24 @@
 var isomorphicDir='../../org.openbravo.userinterface.smartclient/isomorphic/';
 
 function OBStartApplication() {
-  var s = document.getElementById('summary');
-
-  if(OB.User.roleName.indexOf('System Administrator') == -1) {
-    s.innerHTML = 'Test must be executed with System Administrator role';
-    return;
-  }
-  OB.Layout.initialize();
-  // _101 = Reference view definition
-  $LAB.script('../../../org.openbravo.client.kernel/OBUIAPP_MainLayout/View?viewId=_101')
-      .wait(function() {
-
-        var viewName = OB.Layout.ViewManager.loadedWindowClassName,
-            suite = new Benchmark.Suite, summary = '', a = [], i = 0;
-
-        s.innerHTML = 'Executing...';
-
-        suite.add('ViewManager.openView', function() {
-          OB.ViewManager.openView(viewName, {});
-        })
-        .on('cycle', function(bench) {
-          summary += String(bench) + '<br />';
-          summary += 'Elapsed time: ' + bench.times.elapsed + '<br />';
-        })
-        .on('complete', function() {
-          summary += 'Client platform: ' + String(Benchmark.platform) + '<br />';
-          summary += 'Total tabs created: ' + OB.MainView.TabSet.tabs.length;
-          s.innerHTML = summary;
-        })
-        .run(true);
-      });
+  var s = document.getElementById('summary'),
+      suite = new Benchmark.Suite,
+      summary = '';
+  
+  s.innerHTML = 'Executing...';
+  
+  suite.add('Window.create', function() {
+    isc.Window.create({title: 'Test Window'});
+  })
+  .on('cycle', function(bench) {
+    summary += String(bench) + '<br />';
+    summary += 'Elapsed time: ' + bench.times.elapsed + '<br />';
+  })
+  .on('complete', function() {    
+    summary += 'Client platform: ' + String(Benchmark.platform) + '<br />';
+    s.innerHTML = summary;
+  })
+  .run(true);
 }
 </script>
 </head>
@@ -73,4 +61,4 @@
 <iframe name="background_target" id="background_target" height="0" width="0" style="display:none;"></iframe>
 <form name="OBGlobalHiddenForm" method="post" action="blank.html" target="background_target"></form>
 </body>
-</html>
+</html>
\ No newline at end of file