OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "modules/notifications/NotificationResourcesLoader.h" | 5 #include "modules/notifications/NotificationResourcesLoader.h" |
6 | 6 |
7 #include "core/fetch/MemoryCache.h" | 7 #include "core/fetch/MemoryCache.h" |
8 #include "core/testing/DummyPageHolder.h" | 8 #include "core/testing/DummyPageHolder.h" |
9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
10 #include "platform/testing/URLTestHelpers.h" | 10 #include "platform/testing/URLTestHelpers.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 const char kIcon120x120[] = "120x120.png"; | 30 const char kIcon120x120[] = "120x120.png"; |
31 const char kIcon500x500[] = "500x500.png"; | 31 const char kIcon500x500[] = "500x500.png"; |
32 | 32 |
33 const int kMaxIconSizePx = 320; | 33 const int kMaxIconSizePx = 320; |
34 const int kMaxBadgeSizePx = 96; | 34 const int kMaxBadgeSizePx = 96; |
35 const int kMaxActionIconSizePx = 128; | 35 const int kMaxActionIconSizePx = 128; |
36 | 36 |
37 class NotificationResourcesLoaderTest : public ::testing::Test { | 37 class NotificationResourcesLoaderTest : public ::testing::Test { |
38 public: | 38 public: |
39 NotificationResourcesLoaderTest() | 39 NotificationResourcesLoaderTest() |
40 : m_page(DummyPageHolder::create()), m_loader(new NotificationResourcesL
oader(bind(&NotificationResourcesLoaderTest::didFetchResources, this))) | 40 : m_page(DummyPageHolder::create()), m_loader(new NotificationResourcesL
oader(bind(&NotificationResourcesLoaderTest::didFetchResources, WTF::unretained(
this)))) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 ~NotificationResourcesLoaderTest() override | 44 ~NotificationResourcesLoaderTest() override |
45 { | 45 { |
46 m_loader->stop(); | 46 m_loader->stop(); |
47 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); | 47 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs(); |
48 memoryCache()->evictResources(); | 48 memoryCache()->evictResources(); |
49 } | 49 } |
50 | 50 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); | 231 Platform::current()->getURLLoaderMockFactory()->serveAsynchronousRequests(); |
232 | 232 |
233 // Loading should have been cancelled when |stop| was called so no resources | 233 // Loading should have been cancelled when |stop| was called so no resources |
234 // should have been received by the test even though | 234 // should have been received by the test even though |
235 // |serveAsynchronousRequests| was called. | 235 // |serveAsynchronousRequests| was called. |
236 ASSERT_FALSE(resources()); | 236 ASSERT_FALSE(resources()); |
237 } | 237 } |
238 | 238 |
239 } // namespace | 239 } // namespace |
240 } // namespace blink | 240 } // namespace blink |
OLD | NEW |