Chromium Code Reviews| 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); |