virtual void TearDown() { // Regain the ownership of testing memory cache, so that it will be // destroyed. m_testingMemoryCache = adoptPtr(memoryCache()); // Yield the ownership of the global memory cache back. setMemoryCacheForTesting(m_globalMemoryCache.leakPtr()); }
virtual void SetUp() { // Save the global memory cache to restore it upon teardown. m_globalMemoryCache = adoptPtr(memoryCache()); // Create the test memory cache instance and hook it in. m_testingMemoryCache = adoptPtr(new MemoryCache()); setMemoryCacheForTesting(m_testingMemoryCache.leakPtr()); }
virtual void TearDown() { // Garbage collection is required prior to switching out the // test's memory cache; image resources are released, evicting // them from the cache. Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, Heap::ForcedForTesting); // Regain the ownership of testing memory cache, so that it will be // destroyed. m_testingMemoryCache = adoptPtr(memoryCache()); // Yield the ownership of the global memory cache back. setMemoryCacheForTesting(m_globalMemoryCache.leakPtr()); }
virtual void SetUp() { ASSERT_TRUE(m_bitmap.allocN32Pixels(10, 10)); m_bitmap.eraseColor(0xFFFFFFFF); ASSERT_TRUE(m_bitmap2.allocN32Pixels(5, 5)); m_bitmap2.eraseColor(0xAAAAAAAA); // Save the global memory cache to restore it upon teardown. m_globalMemoryCache = adoptPtr(memoryCache()); // Create the test memory cache instance and hook it in. m_testingMemoryCache = adoptPtr(new MemoryCache()); setMemoryCacheForTesting(m_testingMemoryCache.leakPtr()); }
virtual void SetUp() { m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 10, 10); m_bitmap.allocPixels(); m_bitmap.eraseColor(0xFFFFFFFF); m_bitmap2.setConfig(SkBitmap::kARGB_8888_Config, 5, 5); m_bitmap2.allocPixels(); m_bitmap2.eraseColor(0xAAAAAAAA); // Save the global memory cache to restore it upon teardown. m_globalMemoryCache = adoptPtr(memoryCache()); // Create the test memory cache instance and hook it in. m_testingMemoryCache = adoptPtr(new MemoryCache()); setMemoryCacheForTesting(m_testingMemoryCache.leakPtr()); }