forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 978274: Initialize gfxPrefs earlier, rename some methods, delete …
…MigratePrefs from gfxPlatform. r=bgirard.
- Loading branch information
1 parent
3427b3b
commit 2b8bd73
Showing
7 changed files
with
89 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||
/* 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 "gtest/gtest.h" | ||
|
||
#include "gfxPrefs.h" | ||
#ifdef GFX_DECL_PREF | ||
#error "This is not supposed to be defined outside of gfxPrefs.h" | ||
#endif | ||
|
||
// If the default values for any of these preferences change, | ||
// just modify the test to match. We are only testing against | ||
// a particular value to make sure we receive the correct | ||
// result through this API. | ||
|
||
TEST(GfxPrefs, Singleton) { | ||
ASSERT_FALSE(gfxPrefs::SingletonExists()); | ||
gfxPrefs::GetSingleton(); | ||
ASSERT_TRUE(gfxPrefs::SingletonExists()); | ||
gfxPrefs::DestroySingleton(); | ||
ASSERT_FALSE(gfxPrefs::SingletonExists()); | ||
} | ||
|
||
TEST(GfxPrefs, LiveValues) { | ||
ASSERT_FALSE(gfxPrefs::SingletonExists()); | ||
gfxPrefs::GetSingleton(); | ||
ASSERT_TRUE(gfxPrefs::SingletonExists()); | ||
|
||
// Live boolean, default false | ||
ASSERT_FALSE(gfxPrefs::CanvasAzureAccelerated()); | ||
|
||
// Live int32_t, default 23456 | ||
ASSERT_TRUE(gfxPrefs::LayerScopePort() == 23456); | ||
|
||
// Live uint32_t, default 2 | ||
ASSERT_TRUE(gfxPrefs::MSAALevel() == 2); | ||
|
||
gfxPrefs::DestroySingleton(); | ||
ASSERT_FALSE(gfxPrefs::SingletonExists()); | ||
} | ||
|
||
TEST(GfxPrefs, OnceValues) { | ||
ASSERT_FALSE(gfxPrefs::SingletonExists()); | ||
gfxPrefs::GetSingleton(); | ||
ASSERT_TRUE(gfxPrefs::SingletonExists()); | ||
|
||
// Once boolean, default true | ||
ASSERT_TRUE(gfxPrefs::WorkAroundDriverBugs()); | ||
|
||
// Once boolean, default false | ||
ASSERT_FALSE(gfxPrefs::LayersDump()); | ||
|
||
// Once int32_t, default 95 | ||
ASSERT_TRUE(gfxPrefs::CanvasSkiaGLCacheSize() == 96); | ||
|
||
// Once uint32_t, default 5 | ||
ASSERT_TRUE(gfxPrefs::APZMaxVelocityQueueSize() == 5); | ||
|
||
// Once float, default -1 (should be OK with ==) | ||
ASSERT_TRUE(gfxPrefs::APZMaxVelocity() == -1.0f); | ||
|
||
gfxPrefs::DestroySingleton(); | ||
ASSERT_FALSE(gfxPrefs::SingletonExists()); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters