1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
6 #include "core/testing/NullExecutionContext.h"
8 #include "core/dom/ExecutionContextTask.h"
9 #include "core/events/Event.h"
10 #include "core/frame/DOMTimer.h"
16 class NullEventQueue final
: public EventQueue
{
19 ~NullEventQueue() override
{ }
20 bool enqueueEvent(PassRefPtrWillBeRawPtr
<Event
>) override
{ return true; }
21 bool cancelEvent(Event
*) override
{ return true; }
22 void close() override
{ }
27 NullExecutionContext::NullExecutionContext()
28 : m_tasksNeedSuspension(false)
29 , m_queue(adoptPtrWillBeNoop(new NullEventQueue()))
33 void NullExecutionContext::postTask(const WebTraceLocation
&, PassOwnPtr
<ExecutionContextTask
>)
37 double NullExecutionContext::timerAlignmentInterval() const
39 return DOMTimer::visiblePageAlignmentInterval();
42 bool NullExecutionContext::isPrivilegedContext(String
& errorMessage
, const PrivilegeContextCheck privilegeContextCheck
) const