| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 using namespace WebCore; | 44 using namespace WebCore; |
| 45 using namespace WebKit; | 45 using namespace WebKit; |
| 46 | 46 |
| 47 namespace { | 47 namespace { |
| 48 | 48 |
| 49 class MockGraphicsLayerClient : public GraphicsLayerClient { | 49 class MockGraphicsLayerClient : public GraphicsLayerClient { |
| 50 public: | 50 public: |
| 51 virtual void notifyAnimationStarted(const GraphicsLayer*, double time) OVERR
IDE { } | 51 virtual void notifyAnimationStarted(const GraphicsLayer*, double time) OVERR
IDE { } |
| 52 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) OVERRIDE { } | 52 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsL
ayerPaintingPhase, const IntRect& inClip) OVERRIDE { } |
| 53 virtual float deviceScaleFactor() const OVERRIDE { return 2; } | |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 class GraphicsLayerChromiumTest : public testing::Test { | 55 class GraphicsLayerChromiumTest : public testing::Test { |
| 57 public: | 56 public: |
| 58 GraphicsLayerChromiumTest() | 57 GraphicsLayerChromiumTest() |
| 59 { | 58 { |
| 60 m_graphicsLayer = adoptPtr(new GraphicsLayerChromium(&m_client)); | 59 m_graphicsLayer = adoptPtr(new GraphicsLayerChromium(&m_client)); |
| 61 m_platformLayer = m_graphicsLayer->platformLayer(); | 60 m_platformLayer = m_graphicsLayer->platformLayer(); |
| 62 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->creat
eLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest)); | 61 m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->creat
eLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest)); |
| 63 ASSERT(m_layerTreeView); | 62 ASSERT(m_layerTreeView); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); | 148 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); |
| 150 | 149 |
| 151 m_graphicsLayer->setContentsToSolidColor(Color::white); | 150 m_graphicsLayer->setContentsToSolidColor(Color::white); |
| 152 EXPECT_TRUE(m_graphicsLayer->contentsLayer()); | 151 EXPECT_TRUE(m_graphicsLayer->contentsLayer()); |
| 153 | 152 |
| 154 m_graphicsLayer->setContentsToSolidColor(Color()); | 153 m_graphicsLayer->setContentsToSolidColor(Color()); |
| 155 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); | 154 EXPECT_FALSE(m_graphicsLayer->contentsLayer()); |
| 156 } | 155 } |
| 157 | 156 |
| 158 } // namespace | 157 } // namespace |
| OLD | NEW |