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

Quelle  MockWinWidget.h   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/. */


#ifndef GTEST_MockWinWidget_H
#define GTEST_MockWinWidget_H

#include <windows.h>

#include "nsIWidget.h"
#include "Units.h"
#include "mozilla/widget/WindowOcclusionState.h"

class MockWinWidget : public nsIWidget {
 public:
  static RefPtr<MockWinWidget> Create(DWORD aStyle, DWORD aExStyle,
                                      const LayoutDeviceIntRect& aRect);

  NS_DECL_ISUPPORTS_INHERITED

  void NotifyOcclusionState(mozilla::widget::OcclusionState aState) override;

  void SetExpectation(mozilla::widget::OcclusionState aExpectation) {
    mExpectation = aExpectation;
  }

  bool IsExpectingCall() const { return mExpectation != mCurrentState; }

  HWND GetWnd() { return mWnd; }

  nsSizeMode SizeMode() override;
  void SetSizeMode(nsSizeMode aMode) override {}

  void* GetNativeData(uint32_t aDataType) override { return nullptr; }

  nsresult Create(nsIWidget* aParent, const LayoutDeviceIntRect& aRect,
                  const InitData&) override {
    return NS_OK;
  }
  nsresult Create(nsIWidget* aParent, const DesktopIntRect& aRect,
                  const InitData&) override {
    return NS_OK;
  }
  void Show(bool aState) override {}
  bool IsVisible() const override { return true; }
  void Move(const DesktopPoint&) override {}
  void Resize(const DesktopSize&, bool aRepaint) override {}
  void Resize(const DesktopRect&, bool aRepaint) override {}

  void Enable(bool aState) override {}
  bool IsEnabled() const override { return true; }
  void SetFocus(Raise, mozilla::dom::CallerType aCallerType) override {}
  void Invalidate(const LayoutDeviceIntRect& aRect) override {}
  nsresult SetTitle(const nsAString& title) override { return NS_OK; }
  LayoutDeviceIntPoint WidgetToScreenOffset() override {
    return LayoutDeviceIntPoint(0, 0);
  }
  void SetInputContext(const InputContext& aContext,
                       const InputContextAction& aAction) override {}
  InputContext GetInputContext() override { abort(); }
  LayoutDeviceIntRect GetBounds() override { return mBounds; }

 private:
  MockWinWidget();
  ~MockWinWidget();

  bool Initialize(DWORD aStyle, DWORD aExStyle,
                  const LayoutDeviceIntRect& aRect);

  HWND mWnd = 0;
  LayoutDeviceIntRect mBounds;

  mozilla::widget::OcclusionState mExpectation =
      mozilla::widget::OcclusionState::UNKNOWN;
  mozilla::widget::OcclusionState mCurrentState =
      mozilla::widget::OcclusionState::UNKNOWN;
};

#endif

Messung V0.5 in Prozent
C=99 H=100 G=99

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-09-28) ¤

*© 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.