Bug 1861467 - [wpt-sync] Update web-platform-tests to eedf737ce39c512d0ca3471f988972e...
[gecko.git] / dom / workers / WorkerTestUtils.cpp
blob81fa41b03c17ae43fe40b82f75b4c1cc1b4b5c55
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/ErrorResult.h"
8 #include "mozilla/dom/WorkerPrivate.h"
9 #include "mozilla/dom/WorkerTestUtils.h"
11 namespace mozilla::dom {
13 uint32_t WorkerTestUtils::CurrentTimerNestingLevel(const GlobalObject& aGlobal,
14 ErrorResult& aErr) {
15 MOZ_ASSERT(!NS_IsMainThread());
16 WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
17 MOZ_ASSERT(worker);
18 return worker->GetCurrentTimerNestingLevel();
21 } // namespace mozilla::dom