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

Unified Diff: test/mjsunit/d8-performance-now.js

Issue 32433010: Add performance.now() to the d8 shell. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 2 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
« no previous file with comments | « src/d8.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/d8-performance-now.js
diff --git a/test/cctest/test-cpu-ia32.cc b/test/mjsunit/d8-performance-now.js
similarity index 82%
copy from test/cctest/test-cpu-ia32.cc
copy to test/mjsunit/d8-performance-now.js
index 245450bf92b595e417a53edff09a5849d74dd135..090ccefd8e9c62d27afc9a04ef0d7709d2d3789e 100644
--- a/test/cctest/test-cpu-ia32.cc
+++ b/test/mjsunit/d8-performance-now.js
@@ -25,16 +25,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#include "v8.h"
+// Test the window.performance.now() function of d8. This test only makes
+// sense with d8.
Hannes Payer (out of office) 2013/10/23 09:59:51 Can we revive the old test/mjsunit/timer.js here t
Benedikt Meurer 2013/10/24 09:00:49 Done.
-#include "cctest.h"
-#include "cpu.h"
-
-using namespace v8::internal;
-
-
-TEST(RequiredFeaturesX64) {
- // Test for the features required by every x86 CPU in compat/legacy mode.
- CPU cpu;
- CHECK(cpu.has_sahf());
+var init = window.performance.now();
+var prev = init;
+var date = Date.now();
+while (Date.now() <= date + 15) {
+ var next = window.performance.now();
+ assertTrue(next >= prev);
+ prev = next;
}
+assertTrue(window.performance.now() > init);
« no previous file with comments | « src/d8.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698