Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/dom/canvas/gtest/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  TestOffscreenCanvas.cpp

  Sprache: C
 

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "OffscreenCanvasDisplayHelper.h"
#include "gtest/gtest.h"
#include "mozilla/dom/CanvasRenderingContextHelper.h"
#include "mozilla/dom/WorkerRef.h"

namespace mozilla::dom {

// Bug 2004797: Verify UpdateContext preserves ImageContainer.
// Recreating ImageContainer on each call discards existing frames, causing
// flicker when getContext() is called repeatedly.
TEST(OffscreenCanvasDisplayHelper, UpdateContextPreservesImageContainer)
{
  RefPtr<OffscreenCanvasDisplayHelper> helper =
      MakeRefPtr<OffscreenCanvasDisplayHelper>(nullptr, 100100);

  // Initially no ImageContainer
  EXPECT_EQ(helper->GetImageContainer(), nullptr);

  // First UpdateContext creates an ImageContainer
  helper->UpdateContext(nullptr, nullptr, CanvasContextType::Canvas2D,
                        Nothing());
  RefPtr<layers::ImageContainer> container1 = helper->GetImageContainer();
  EXPECT_NE(container1, nullptr);

  // Second UpdateContext should preserve the same ImageContainer
  helper->UpdateContext(nullptr, nullptr, CanvasContextType::Canvas2D,
                        Nothing());
  RefPtr<layers::ImageContainer> container2 = helper->GetImageContainer();
  EXPECT_EQ(container1.get(), container2.get());
}

}  // namespace mozilla::dom

Messung V0.5 in Prozent
C=81 H=99 G=90

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.