Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
michael@0 | 2 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #pragma once |
michael@0 | 7 | |
michael@0 | 8 | #include "2D.h" |
michael@0 | 9 | #include "TestBase.h" |
michael@0 | 10 | |
michael@0 | 11 | #define DT_WIDTH 500 |
michael@0 | 12 | #define DT_HEIGHT 500 |
michael@0 | 13 | |
michael@0 | 14 | /* This general DrawTarget test class can be reimplemented by a child class |
michael@0 | 15 | * with optional additional drawtarget-specific tests. And is intended to run |
michael@0 | 16 | * on a 500x500 32 BPP drawtarget. |
michael@0 | 17 | */ |
michael@0 | 18 | class TestDrawTargetBase : public TestBase |
michael@0 | 19 | { |
michael@0 | 20 | public: |
michael@0 | 21 | void Initialized(); |
michael@0 | 22 | void FillCompletely(); |
michael@0 | 23 | void FillRect(); |
michael@0 | 24 | |
michael@0 | 25 | protected: |
michael@0 | 26 | TestDrawTargetBase(); |
michael@0 | 27 | |
michael@0 | 28 | void RefreshSnapshot(); |
michael@0 | 29 | |
michael@0 | 30 | void VerifyAllPixels(const mozilla::gfx::Color &aColor); |
michael@0 | 31 | void VerifyPixel(const mozilla::gfx::IntPoint &aPoint, |
michael@0 | 32 | mozilla::gfx::Color &aColor); |
michael@0 | 33 | |
michael@0 | 34 | uint32_t RGBAPixelFromColor(const mozilla::gfx::Color &aColor); |
michael@0 | 35 | |
michael@0 | 36 | mozilla::RefPtr<mozilla::gfx::DrawTarget> mDT; |
michael@0 | 37 | mozilla::RefPtr<mozilla::gfx::DataSourceSurface> mDataSnapshot; |
michael@0 | 38 | }; |