Search in sources :

Example 1 with Timers

use of com.github.anba.es6draft.runtime.extensions.timer.Timers in project es6draft by anba.

the class PromiseUnwrappingTest method setUp.

@Before
public void setUp() throws Throwable {
    assumeTrue("Test disabled", test.isEnabled());
    realm.initialize(new SystemConsole(), test);
    exceptionHandler.setExecutionContext(realm.get().defaultContext());
    async = realm.get().createGlobalProperties(new PromiseAsync(), PromiseAsync.class);
    timers = realm.get().createGlobalProperties(new Timers(), Timers.class);
}
Also used : SystemConsole(com.github.anba.es6draft.util.SystemConsole) Timers(com.github.anba.es6draft.runtime.extensions.timer.Timers) Before(org.junit.Before)

Example 2 with Timers

use of com.github.anba.es6draft.runtime.extensions.timer.Timers in project es6draft by anba.

the class PromiseAPlusTest method setUp.

@Before
public void setUp() throws Throwable {
    assumeTrue("Test disabled", test.isEnabled());
    realm.initialize(new SystemConsole(), test);
    exceptionHandler.setExecutionContext(realm.get().defaultContext());
    async = realm.get().createGlobalProperties(new PromiseAsync(), PromiseAsync.class);
    timers = realm.get().createGlobalProperties(new Timers(), Timers.class);
}
Also used : SystemConsole(com.github.anba.es6draft.util.SystemConsole) Timers(com.github.anba.es6draft.runtime.extensions.timer.Timers) Before(org.junit.Before)

Example 3 with Timers

use of com.github.anba.es6draft.runtime.extensions.timer.Timers in project es6draft by anba.

the class UnhandledRejectionTest method setUp.

@Before
public void setUp() throws Throwable {
    assumeTrue("Test disabled", test.isEnabled());
    realm.initialize(new SystemConsole(), test);
    exceptionHandler.setExecutionContext(realm.get().defaultContext());
    timers = realm.get().createGlobalProperties(new Timers(), Timers.class);
    if (test.negative) {
        expected.expect(Matchers.either(Matchers.instanceOf(UnhandledRejectionException.class)).or(Matchers.instanceOf(MissingRejectionException.class)));
    } else {
        errorHandler.match(StandardErrorHandler.defaultMatcher());
        exceptionHandler.match(ScriptExceptionHandler.defaultMatcher());
    }
}
Also used : UnhandledRejectionException(com.github.anba.es6draft.runtime.internal.UnhandledRejectionException) SystemConsole(com.github.anba.es6draft.util.SystemConsole) Timers(com.github.anba.es6draft.runtime.extensions.timer.Timers) Before(org.junit.Before)

Example 4 with Timers

use of com.github.anba.es6draft.runtime.extensions.timer.Timers in project es6draft by anba.

the class ES6Test method setUp.

@Before
public void setUp() throws Throwable {
    assumeTrue("Test disabled", test.isEnabled());
    realm.initialize(new NullConsole(), test);
    timers = realm.get().createGlobalProperties(new Timers(), Timers.class);
    realm.get().createGlobalProperties(new DrainMicrotasks(), DrainMicrotasks.class);
    exceptionHandler.setExecutionContext(realm.get().defaultContext());
}
Also used : NullConsole(com.github.anba.es6draft.util.NullConsole) Timers(com.github.anba.es6draft.runtime.extensions.timer.Timers) Before(org.junit.Before)

Aggregations

Timers (com.github.anba.es6draft.runtime.extensions.timer.Timers)4 Before (org.junit.Before)4 SystemConsole (com.github.anba.es6draft.util.SystemConsole)3 UnhandledRejectionException (com.github.anba.es6draft.runtime.internal.UnhandledRejectionException)1 NullConsole (com.github.anba.es6draft.util.NullConsole)1