Commit 83afcbcc authored by tfarina@chromium.org's avatar tfarina@chromium.org

ui: No need to typedef testing::Test in unittests.

TEST() macro should be used instead.

TEST=ui_unittests
R=sky@chromium.org

Review URL: https://chromiumcodereview.appspot.com/10808072

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148710 0039d316-1c4b-4281-b951-d872f2087c98
parent af7023c1
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/message_loop.h" #include "base/message_loop.h"
#include "base/string_split.h" #include "base/string_split.h"
#include "base/time.h" #include "base/time.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/skia/include/core/SkXfermode.h" #include "third_party/skia/include/core/SkXfermode.h"
#include "ui/aura/env.h" #include "ui/aura/env.h"
#include "ui/aura/event.h" #include "ui/aura/event.h"
...@@ -28,7 +29,6 @@ ...@@ -28,7 +29,6 @@
#include "ui/gfx/canvas.h" #include "ui/gfx/canvas.h"
#include "ui/gfx/rect.h" #include "ui/gfx/rect.h"
#include "ui/gfx/skia_util.h" #include "ui/gfx/skia_util.h"
#include "third_party/khronos/GLES2/gl2.h"
#ifndef GL_GLEXT_PROTOTYPES #ifndef GL_GLEXT_PROTOTYPES
#define GL_GLEXT_PROTOTYPES 1 #define GL_GLEXT_PROTOTYPES 1
#endif #endif
...@@ -279,7 +279,7 @@ class SoftwareScrollBench : public BenchCompositorObserver { ...@@ -279,7 +279,7 @@ class SoftwareScrollBench : public BenchCompositorObserver {
DISALLOW_COPY_AND_ASSIGN(SoftwareScrollBench); DISALLOW_COPY_AND_ASSIGN(SoftwareScrollBench);
}; };
} // anonymous namespace } // namespace
int main(int argc, char** argv) { int main(int argc, char** argv) {
CommandLine::Init(argc, argv); CommandLine::Init(argc, argv);
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
// //
// // Use this to define a non exported property that is primitive, // // Use this to define a non exported property that is primitive,
// // or a pointer you don't want to automatically deleted, and is used // // or a pointer you don't want to automatically deleted, and is used
// // only in a specific file. This will define the property in anonymous // // only in a specific file. This will define the property in an unnamed
// // namespace which cannot be accessed from another file. // // namespace which cannot be accessed from another file.
// DEFINE_LOCAL_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); // DEFINE_LOCAL_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault);
// //
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#import "ui/base/keycodes/keyboard_code_conversion_mac.h" #import "ui/base/keycodes/keyboard_code_conversion_mac.h"
#include <algorithm> #include <algorithm>
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
#include "base/logging.h" #include "base/logging.h"
...@@ -447,7 +448,7 @@ KeyboardCode KeyboardCodeFromKeyCode(unsigned short keyCode) { ...@@ -447,7 +448,7 @@ KeyboardCode KeyboardCodeFromKeyCode(unsigned short keyCode) {
return kKeyboardCodes[keyCode]; return kKeyboardCodes[keyCode];
} }
} // anonymous namespace } // namespace
int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode, int MacKeyCodeForWindowsKeyCode(KeyboardCode keycode,
NSUInteger flags, NSUInteger flags,
......
...@@ -33,7 +33,7 @@ FilePath GetResourcesPakFilePath(const std::string& pak_name) { ...@@ -33,7 +33,7 @@ FilePath GetResourcesPakFilePath(const std::string& pak_name) {
return FilePath(ASCIIToUTF16(pak_name)); return FilePath(ASCIIToUTF16(pak_name));
} }
} // end anonymous namespace } // namespace
void ResourceBundle::LoadCommonResources() { void ResourceBundle::LoadCommonResources() {
// As a convenience, add the current resource module as a data packs. // As a convenience, add the current resource module as a data packs.
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// This file implements utility functions for eliding and formatting UI text. // This file implements utility functions for eliding and formatting UI text.
// //
// Note that several of the functions declared in text_elider.h are implemented // Note that several of the functions declared in text_elider.h are implemented
// in this file using helper classes in the anonymous namespace. // in this file using helper classes in an unnamed namespace.
#include "ui/base/text/text_elider.h" #include "ui/base/text/text_elider.h"
......
...@@ -2,15 +2,14 @@ ...@@ -2,15 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "ui/base/win/hwnd_subclass.h"
#include "base/basictypes.h" #include "base/basictypes.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/win/window_impl.h" #include "ui/base/win/window_impl.h"
#include "ui/base/win/hwnd_subclass.h"
namespace ui { namespace ui {
typedef testing::Test HWNDSubclassTest;
namespace { namespace {
class TestWindow : public ui::WindowImpl { class TestWindow : public ui::WindowImpl {
...@@ -68,7 +67,7 @@ class TestMessageFilter : public HWNDMessageFilter { ...@@ -68,7 +67,7 @@ class TestMessageFilter : public HWNDMessageFilter {
} // namespace } // namespace
TEST_F(HWNDSubclassTest, Filtering) { TEST(HWNDSubclassTest, Filtering) {
TestWindow window; TestWindow window;
window.Init(NULL, gfx::Rect(0, 0, 100, 100)); window.Init(NULL, gfx::Rect(0, 0, 100, 100));
EXPECT_TRUE(window.hwnd() != NULL); EXPECT_TRUE(window.hwnd() != NULL);
...@@ -97,7 +96,7 @@ TEST_F(HWNDSubclassTest, Filtering) { ...@@ -97,7 +96,7 @@ TEST_F(HWNDSubclassTest, Filtering) {
} }
} }
TEST_F(HWNDSubclassTest, FilteringMultipleFilters) { TEST(HWNDSubclassTest, FilteringMultipleFilters) {
TestWindow window; TestWindow window;
window.Init(NULL, gfx::Rect(0, 0, 100, 100)); window.Init(NULL, gfx::Rect(0, 0, 100, 100));
EXPECT_TRUE(window.hwnd() != NULL); EXPECT_TRUE(window.hwnd() != NULL);
...@@ -131,7 +130,7 @@ TEST_F(HWNDSubclassTest, FilteringMultipleFilters) { ...@@ -131,7 +130,7 @@ TEST_F(HWNDSubclassTest, FilteringMultipleFilters) {
} }
} }
TEST_F(HWNDSubclassTest, RemoveFilter) { TEST(HWNDSubclassTest, RemoveFilter) {
TestWindow window; TestWindow window;
window.Init(NULL, gfx::Rect(0, 0, 100, 100)); window.Init(NULL, gfx::Rect(0, 0, 100, 100));
EXPECT_TRUE(window.hwnd() != NULL); EXPECT_TRUE(window.hwnd() != NULL);
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" #include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/images/SkImageEncoder.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatPoint.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h" #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebSize.h"
#include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h"
#include "third_party/skia/include/images/SkImageEncoder.h"
#include "ui/compositor/compositor_observer.h" #include "ui/compositor/compositor_observer.h"
#include "ui/compositor/compositor_switches.h" #include "ui/compositor/compositor_switches.h"
#include "ui/compositor/dip_util.h" #include "ui/compositor/dip_util.h"
...@@ -40,7 +40,7 @@ bool test_compositor_enabled = false; ...@@ -40,7 +40,7 @@ bool test_compositor_enabled = false;
ui::ContextFactory* g_context_factory = NULL; ui::ContextFactory* g_context_factory = NULL;
} // anonymous namespace } // namespace
namespace ui { namespace ui {
......
...@@ -12,7 +12,7 @@ namespace { ...@@ -12,7 +12,7 @@ namespace {
static const base::TimeDelta kDefaultTransitionDuration = static const base::TimeDelta kDefaultTransitionDuration =
base::TimeDelta::FromMilliseconds(200); base::TimeDelta::FromMilliseconds(200);
} // namespace; } // namespace
namespace ui { namespace ui {
...@@ -71,4 +71,3 @@ ScopedLayerAnimationSettings::GetPreemptionStrategy() const { ...@@ -71,4 +71,3 @@ ScopedLayerAnimationSettings::GetPreemptionStrategy() const {
} }
} // namespace ui } // namespace ui
...@@ -188,7 +188,7 @@ int AdjustPlatformSpecificFlags(const string16& text, int flags) { ...@@ -188,7 +188,7 @@ int AdjustPlatformSpecificFlags(const string16& text, int flags) {
return flags; return flags;
} }
} // anonymous namespace } // namespace
namespace gfx { namespace gfx {
......
...@@ -29,16 +29,14 @@ std::string FontToString(const gfx::Font& font) { ...@@ -29,16 +29,14 @@ std::string FontToString(const gfx::Font& font) {
namespace gfx { namespace gfx {
typedef testing::Test FontListTest; TEST(FontListTest, FontDescString_FromDescString) {
TEST_F(FontListTest, FontDescString_FromDescString) {
// Test init from font name style size string. // Test init from font name style size string.
FontList font_list = FontList("Droid Sans serif, Sans serif, 10px"); FontList font_list = FontList("Droid Sans serif, Sans serif, 10px");
const std::string& font_str = font_list.GetFontDescriptionString(); const std::string& font_str = font_list.GetFontDescriptionString();
EXPECT_EQ("Droid Sans serif, Sans serif, 10px", font_str); EXPECT_EQ("Droid Sans serif, Sans serif, 10px", font_str);
} }
TEST_F(FontListTest, FontDescString_FromFont) { TEST(FontListTest, FontDescString_FromFont) {
// Test init from Font. // Test init from Font.
Font font("Arial", 8); Font font("Arial", 8);
FontList font_list = FontList(font); FontList font_list = FontList(font);
...@@ -46,7 +44,7 @@ TEST_F(FontListTest, FontDescString_FromFont) { ...@@ -46,7 +44,7 @@ TEST_F(FontListTest, FontDescString_FromFont) {
EXPECT_EQ("Arial,8px", font_str); EXPECT_EQ("Arial,8px", font_str);
} }
TEST_F(FontListTest, FontDescString_FromFontWithNonNormalStyle) { TEST(FontListTest, FontDescString_FromFontWithNonNormalStyle) {
// Test init from Font with non-normal style. // Test init from Font with non-normal style.
Font font("Arial", 8); Font font("Arial", 8);
FontList font_list = FontList(font.DeriveFont(2, Font::BOLD)); FontList font_list = FontList(font.DeriveFont(2, Font::BOLD));
...@@ -56,7 +54,7 @@ TEST_F(FontListTest, FontDescString_FromFontWithNonNormalStyle) { ...@@ -56,7 +54,7 @@ TEST_F(FontListTest, FontDescString_FromFontWithNonNormalStyle) {
EXPECT_EQ("Arial,Italic 6px", font_list.GetFontDescriptionString()); EXPECT_EQ("Arial,Italic 6px", font_list.GetFontDescriptionString());
} }
TEST_F(FontListTest, FontDescString_FromFontVector) { TEST(FontListTest, FontDescString_FromFontVector) {
// Test init from Font vector. // Test init from Font vector.
Font font("Arial", 8); Font font("Arial", 8);
Font font_1("Sans serif", 10); Font font_1("Sans serif", 10);
...@@ -68,7 +66,7 @@ TEST_F(FontListTest, FontDescString_FromFontVector) { ...@@ -68,7 +66,7 @@ TEST_F(FontListTest, FontDescString_FromFontVector) {
EXPECT_EQ("Arial,Sans serif,Bold 8px", font_str); EXPECT_EQ("Arial,Sans serif,Bold 8px", font_str);
} }
TEST_F(FontListTest, Fonts_FromDescString) { TEST(FontListTest, Fonts_FromDescString) {
// Test init from font name size string. // Test init from font name size string.
FontList font_list = FontList("serif,Sans serif, 13px"); FontList font_list = FontList("serif,Sans serif, 13px");
const std::vector<Font>& fonts = font_list.GetFonts(); const std::vector<Font>& fonts = font_list.GetFonts();
...@@ -77,7 +75,7 @@ TEST_F(FontListTest, Fonts_FromDescString) { ...@@ -77,7 +75,7 @@ TEST_F(FontListTest, Fonts_FromDescString) {
EXPECT_EQ("Sans serif|13", FontToString(fonts[1])); EXPECT_EQ("Sans serif|13", FontToString(fonts[1]));
} }
TEST_F(FontListTest, Fonts_FromDescStringInFlexibleFormat) { TEST(FontListTest, Fonts_FromDescStringInFlexibleFormat) {
// Test init from font name size string with flexible format. // Test init from font name size string with flexible format.
FontList font_list = FontList(" serif , Sans serif , 13px"); FontList font_list = FontList(" serif , Sans serif , 13px");
const std::vector<Font>& fonts = font_list.GetFonts(); const std::vector<Font>& fonts = font_list.GetFonts();
...@@ -86,7 +84,7 @@ TEST_F(FontListTest, Fonts_FromDescStringInFlexibleFormat) { ...@@ -86,7 +84,7 @@ TEST_F(FontListTest, Fonts_FromDescStringInFlexibleFormat) {
EXPECT_EQ("Sans serif|13", FontToString(fonts[1])); EXPECT_EQ("Sans serif|13", FontToString(fonts[1]));
} }
TEST_F(FontListTest, Fonts_FromDescStringWithStyleInFlexibleFormat) { TEST(FontListTest, Fonts_FromDescStringWithStyleInFlexibleFormat) {
// Test init from font name style size string with flexible format. // Test init from font name style size string with flexible format.
FontList font_list = FontList(" serif , Sans serif , Bold " FontList font_list = FontList(" serif , Sans serif , Bold "
" Italic 13px"); " Italic 13px");
...@@ -96,7 +94,7 @@ TEST_F(FontListTest, Fonts_FromDescStringWithStyleInFlexibleFormat) { ...@@ -96,7 +94,7 @@ TEST_F(FontListTest, Fonts_FromDescStringWithStyleInFlexibleFormat) {
EXPECT_EQ("Sans serif|13|bold|italic", FontToString(fonts[1])); EXPECT_EQ("Sans serif|13|bold|italic", FontToString(fonts[1]));
} }
TEST_F(FontListTest, Fonts_FromFont) { TEST(FontListTest, Fonts_FromFont) {
// Test init from Font. // Test init from Font.
Font font("Arial", 8); Font font("Arial", 8);
FontList font_list = FontList(font); FontList font_list = FontList(font);
...@@ -105,7 +103,7 @@ TEST_F(FontListTest, Fonts_FromFont) { ...@@ -105,7 +103,7 @@ TEST_F(FontListTest, Fonts_FromFont) {
EXPECT_EQ("Arial|8", FontToString(fonts[0])); EXPECT_EQ("Arial|8", FontToString(fonts[0]));
} }
TEST_F(FontListTest, Fonts_FromFontWithNonNormalStyle) { TEST(FontListTest, Fonts_FromFontWithNonNormalStyle) {
// Test init from Font with non-normal style. // Test init from Font with non-normal style.
Font font("Arial", 8); Font font("Arial", 8);
FontList font_list = FontList(font.DeriveFont(2, Font::BOLD)); FontList font_list = FontList(font.DeriveFont(2, Font::BOLD));
...@@ -119,7 +117,7 @@ TEST_F(FontListTest, Fonts_FromFontWithNonNormalStyle) { ...@@ -119,7 +117,7 @@ TEST_F(FontListTest, Fonts_FromFontWithNonNormalStyle) {
EXPECT_EQ("Arial|6|italic", FontToString(fonts[0])); EXPECT_EQ("Arial|6|italic", FontToString(fonts[0]));
} }
TEST_F(FontListTest, Fonts_FromFontVector) { TEST(FontListTest, Fonts_FromFontVector) {
// Test init from Font vector. // Test init from Font vector.
Font font("Arial", 8); Font font("Arial", 8);
Font font_1("Sans serif", 10); Font font_1("Sans serif", 10);
...@@ -133,7 +131,7 @@ TEST_F(FontListTest, Fonts_FromFontVector) { ...@@ -133,7 +131,7 @@ TEST_F(FontListTest, Fonts_FromFontVector) {
EXPECT_EQ("Sans serif|8|bold", FontToString(fonts[1])); EXPECT_EQ("Sans serif|8|bold", FontToString(fonts[1]));
} }
TEST_F(FontListTest, Fonts_DescStringWithStyleInFlexibleFormat_RoundTrip) { TEST(FontListTest, Fonts_DescStringWithStyleInFlexibleFormat_RoundTrip) {
// Test round trip from font description string to font vector to // Test round trip from font description string to font vector to
// font description string. // font description string.
FontList font_list = FontList(" serif , Sans serif , Bold " FontList font_list = FontList(" serif , Sans serif , Bold "
...@@ -146,7 +144,7 @@ TEST_F(FontListTest, Fonts_DescStringWithStyleInFlexibleFormat_RoundTrip) { ...@@ -146,7 +144,7 @@ TEST_F(FontListTest, Fonts_DescStringWithStyleInFlexibleFormat_RoundTrip) {
EXPECT_EQ("serif,Sans serif,Bold Italic 13px", desc_str); EXPECT_EQ("serif,Sans serif,Bold Italic 13px", desc_str);
} }
TEST_F(FontListTest, Fonts_FontVector_RoundTrip) { TEST(FontListTest, Fonts_FontVector_RoundTrip) {
// Test round trip from font vector to font description string to font vector. // Test round trip from font vector to font description string to font vector.
Font font("Arial", 8); Font font("Arial", 8);
Font font_1("Sans serif", 10); Font font_1("Sans serif", 10);
...@@ -164,7 +162,7 @@ TEST_F(FontListTest, Fonts_FontVector_RoundTrip) { ...@@ -164,7 +162,7 @@ TEST_F(FontListTest, Fonts_FontVector_RoundTrip) {
EXPECT_EQ("Sans serif|8|bold", FontToString(round_trip_fonts[1])); EXPECT_EQ("Sans serif|8|bold", FontToString(round_trip_fonts[1]));
} }
TEST_F(FontListTest, FontDescString_GetStyle) { TEST(FontListTest, FontDescString_GetStyle) {
FontList font_list = FontList("Arial,Sans serif, 8px"); FontList font_list = FontList("Arial,Sans serif, 8px");
EXPECT_EQ(Font::NORMAL, font_list.GetFontStyle()); EXPECT_EQ(Font::NORMAL, font_list.GetFontStyle());
...@@ -178,7 +176,7 @@ TEST_F(FontListTest, FontDescString_GetStyle) { ...@@ -178,7 +176,7 @@ TEST_F(FontListTest, FontDescString_GetStyle) {
EXPECT_EQ(Font::BOLD | Font::ITALIC, font_list.GetFontStyle()); EXPECT_EQ(Font::BOLD | Font::ITALIC, font_list.GetFontStyle());
} }
TEST_F(FontListTest, Fonts_GetStyle) { TEST(FontListTest, Fonts_GetStyle) {
std::vector<Font> fonts; std::vector<Font> fonts;
fonts.push_back(gfx::Font("Arial", 8)); fonts.push_back(gfx::Font("Arial", 8));
fonts.push_back(gfx::Font("Sans serif", 8)); fonts.push_back(gfx::Font("Sans serif", 8));
...@@ -190,7 +188,7 @@ TEST_F(FontListTest, Fonts_GetStyle) { ...@@ -190,7 +188,7 @@ TEST_F(FontListTest, Fonts_GetStyle) {
EXPECT_EQ(Font::ITALIC | Font::BOLD, font_list.GetFontStyle()); EXPECT_EQ(Font::ITALIC | Font::BOLD, font_list.GetFontStyle());
} }
TEST_F(FontListTest, FontDescString_DeriveFontList) { TEST(FontListTest, FontDescString_DeriveFontList) {
FontList font_list = FontList("Arial,Sans serif, 8px"); FontList font_list = FontList("Arial,Sans serif, 8px");
FontList derived = font_list.DeriveFontList(Font::BOLD | Font::ITALIC); FontList derived = font_list.DeriveFontList(Font::BOLD | Font::ITALIC);
...@@ -198,7 +196,7 @@ TEST_F(FontListTest, FontDescString_DeriveFontList) { ...@@ -198,7 +196,7 @@ TEST_F(FontListTest, FontDescString_DeriveFontList) {
derived.GetFontDescriptionString()); derived.GetFontDescriptionString());
} }
TEST_F(FontListTest, Fonts_DeriveFontList) { TEST(FontListTest, Fonts_DeriveFontList) {
std::vector<Font> fonts; std::vector<Font> fonts;
fonts.push_back(gfx::Font("Arial", 8)); fonts.push_back(gfx::Font("Arial", 8));
fonts.push_back(gfx::Font("Sans serif", 8)); fonts.push_back(gfx::Font("Sans serif", 8));
...@@ -212,7 +210,7 @@ TEST_F(FontListTest, Fonts_DeriveFontList) { ...@@ -212,7 +210,7 @@ TEST_F(FontListTest, Fonts_DeriveFontList) {
EXPECT_EQ("Sans serif|8|bold|italic", FontToString(derived_fonts[1])); EXPECT_EQ("Sans serif|8|bold|italic", FontToString(derived_fonts[1]));
} }
TEST_F(FontListTest, FontDescString_DeriveFontListWithSize) { TEST(FontListTest, FontDescString_DeriveFontListWithSize) {
FontList font_list = FontList("Arial,Sans serif,Bold Italic 8px"); FontList font_list = FontList("Arial,Sans serif,Bold Italic 8px");
FontList derived = font_list.DeriveFontListWithSize(10); FontList derived = font_list.DeriveFontListWithSize(10);
...@@ -220,7 +218,7 @@ TEST_F(FontListTest, FontDescString_DeriveFontListWithSize) { ...@@ -220,7 +218,7 @@ TEST_F(FontListTest, FontDescString_DeriveFontListWithSize) {
derived.GetFontDescriptionString()); derived.GetFontDescriptionString());
} }
TEST_F(FontListTest, Fonts_DeriveFontListWithSize) { TEST(FontListTest, Fonts_DeriveFontListWithSize) {
std::vector<Font> fonts; std::vector<Font> fonts;
fonts.push_back(gfx::Font("Arial", 8)); fonts.push_back(gfx::Font("Arial", 8));
fonts.push_back(gfx::Font("Sans serif", 8)); fonts.push_back(gfx::Font("Sans serif", 8));
......
...@@ -286,7 +286,7 @@ class DropShadowSource : public ImageSkiaSource { ...@@ -286,7 +286,7 @@ class DropShadowSource : public ImageSkiaSource {
DISALLOW_COPY_AND_ASSIGN(DropShadowSource); DISALLOW_COPY_AND_ASSIGN(DropShadowSource);
}; };
} // namespace; } // namespace
// static // static
ImageSkia ImageSkiaOperations::CreateBlendedImage(const ImageSkia& first, ImageSkia ImageSkiaOperations::CreateBlendedImage(const ImageSkia& first,
......
...@@ -4,12 +4,12 @@ ...@@ -4,12 +4,12 @@
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/layout.h"
#include "ui/gfx/image/image_skia_rep.h" #include "ui/gfx/image/image_skia_rep.h"
#include "ui/gfx/image/image_skia_source.h" #include "ui/gfx/image/image_skia_source.h"
#include "ui/gfx/size.h" #include "ui/gfx/size.h"
#include "ui/base/layout.h"
namespace gfx { namespace gfx {
...@@ -65,9 +65,7 @@ class NullSource: public ImageSkiaSource { ...@@ -65,9 +65,7 @@ class NullSource: public ImageSkiaSource {
DISALLOW_COPY_AND_ASSIGN(NullSource); DISALLOW_COPY_AND_ASSIGN(NullSource);
}; };
} // namespace; } // namespace
typedef testing::Test ImageSkiaTest;
TEST(ImageSkiaTest, FixedSource) { TEST(ImageSkiaTest, FixedSource) {
ImageSkiaRep image(Size(100, 200), ui::SCALE_FACTOR_100P); ImageSkiaRep image(Size(100, 200), ui::SCALE_FACTOR_100P);
......
...@@ -8,16 +8,14 @@ ...@@ -8,16 +8,14 @@
namespace { namespace {
typedef testing::Test ScreenTest; TEST(ScreenTest, GetPrimaryDisplaySize) {
TEST_F(ScreenTest, GetPrimaryDisplaySize) {
// We aren't actually testing that it's correct, just that it's sane. // We aren't actually testing that it's correct, just that it's sane.
const gfx::Size size = gfx::Screen::GetPrimaryDisplay().size(); const gfx::Size size = gfx::Screen::GetPrimaryDisplay().size();
EXPECT_GE(size.width(), 1); EXPECT_GE(size.width(), 1);
EXPECT_GE(size.height(), 1); EXPECT_GE(size.height(), 1);
} }
TEST_F(ScreenTest, GetNumDisplays) { TEST(ScreenTest, GetNumDisplays) {
// We aren't actually testing that it's correct, just that it's sane. // We aren't actually testing that it's correct, just that it's sane.
EXPECT_GE(gfx::Screen::GetNumDisplays(), 1); EXPECT_GE(gfx::Screen::GetNumDisplays(), 1);
} }
......
...@@ -30,7 +30,7 @@ class ScopedPtrXFree { ...@@ -30,7 +30,7 @@ class ScopedPtrXFree {
} }
}; };
} // namespace anonymous } // namespace
GLContextGLX::GLContextGLX(GLShareGroup* share_group) GLContextGLX::GLContextGLX(GLShareGroup* share_group)
: GLContext(share_group), : GLContext(share_group),
......
...@@ -38,7 +38,7 @@ base::NativeLibrary LoadLibrary(const char* filename) { ...@@ -38,7 +38,7 @@ base::NativeLibrary LoadLibrary(const char* filename) {
return LoadLibrary(FilePath(filename)); return LoadLibrary(FilePath(filename));
} }
} // namespace anonymous } // namespace
void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
impls->push_back(kGLImplementationEGLGLES2); impls->push_back(kGLImplementationEGLGLES2);
......
...@@ -45,7 +45,7 @@ base::NativeLibrary LoadLibrary(const char* filename) { ...@@ -45,7 +45,7 @@ base::NativeLibrary LoadLibrary(const char* filename) {
return LoadLibrary(FilePath(filename)); return LoadLibrary(FilePath(filename));
} }
} // namespace anonymous } // namespace
void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
impls->push_back(kGLImplementationDesktopGL); impls->push_back(kGLImplementationDesktopGL);
......
...@@ -16,7 +16,7 @@ namespace gfx { ...@@ -16,7 +16,7 @@ namespace gfx {
namespace { namespace {
const char kOpenGLFrameworkPath[] = const char kOpenGLFrameworkPath[] =
"/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"; "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL";
} // namespace anonymous } // namespace
void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
impls->push_back(kGLImplementationDesktopGL); impls->push_back(kGLImplementationDesktopGL);
......
...@@ -51,7 +51,7 @@ bool LoadD3DXLibrary(const FilePath& module_path, ...@@ -51,7 +51,7 @@ bool LoadD3DXLibrary(const FilePath& module_path,
return true; return true;
} }
} // namespace anonymous } // namespace
void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) {
impls->push_back(kGLImplementationEGLGLES2); impls->push_back(kGLImplementationEGLGLES2);
......
...@@ -37,7 +37,7 @@ Display* g_display; ...@@ -37,7 +37,7 @@ Display* g_display;
const char* g_glx_extensions = NULL; const char* g_glx_extensions = NULL;
bool g_glx_create_context_robustness_supported = false; bool g_glx_create_context_robustness_supported = false;
} // namespace anonymous } // namespace
GLSurfaceGLX::GLSurfaceGLX() {} GLSurfaceGLX::GLSurfaceGLX() {}
......
...@@ -20,7 +20,7 @@ namespace gfx { ...@@ -20,7 +20,7 @@ namespace gfx {
namespace { namespace {
Display* g_osmesa_display; Display* g_osmesa_display;
} // namespace anonymous } // namespace
// This OSMesa GL surface can use XLib to swap the contents of the buffer to a // This OSMesa GL surface can use XLib to swap the contents of the buffer to a
// view. // view.
......
...@@ -158,7 +158,7 @@ bool CreateTemporarySurface(IDirect3DDevice9* device, ...@@ -158,7 +158,7 @@ bool CreateTemporarySurface(IDirect3DDevice9* device,
return SUCCEEDED(hr); return SUCCEEDED(hr);
} }
} // namespace anonymous } // namespace
// A PresentThread is a thread that is dedicated to presenting surfaces to a // A PresentThread is a thread that is dedicated to presenting surfaces to a
// window. It owns a Direct3D device and a Direct3D query for this purpose. // window. It owns a Direct3D device and a Direct3D query for this purpose.
......
...@@ -209,7 +209,7 @@ void EventQueueWatcher(const base::Closure& task) { ...@@ -209,7 +209,7 @@ void EventQueueWatcher(const base::Closure& task) {
// when firing keyboard and mouse click events. // when firing keyboard and mouse click events.
NSPoint g_mouse_location = { 0, 0 }; NSPoint g_mouse_location = { 0, 0 };
} // anonymous namespace } // namespace
namespace ui_controls { namespace ui_controls {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment