| OLD | NEW |
| 1 // Copyright 2016 Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/NotificationImageLoader.h" | 5 #include "modules/notifications/NotificationImageLoader.h" |
| 6 | 6 |
| 7 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
| 8 #include "core/testing/DummyPageHolder.h" | 8 #include "core/testing/DummyPageHolder.h" |
| 9 #include "platform/loader/fetch/MemoryCache.h" | 9 #include "platform/loader/fetch/MemoryCache.h" |
| 10 #include "platform/testing/HistogramTester.h" | 10 #include "platform/testing/HistogramTester.h" |
| 11 #include "platform/testing/TestingPlatformSupport.h" | 11 #include "platform/testing/TestingPlatformSupport.h" |
| 12 #include "platform/testing/URLTestHelpers.h" | 12 #include "platform/testing/URLTestHelpers.h" |
| 13 #include "platform/testing/UnitTestHelpers.h" | 13 #include "platform/testing/UnitTestHelpers.h" |
| 14 #include "platform/wtf/Functional.h" |
| 14 #include "public/platform/Platform.h" | 15 #include "public/platform/Platform.h" |
| 15 #include "public/platform/WebURL.h" | 16 #include "public/platform/WebURL.h" |
| 16 #include "public/platform/WebURLLoaderMockFactory.h" | 17 #include "public/platform/WebURLLoaderMockFactory.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "third_party/WebKit/Source/platform/weborigin/KURL.h" | 19 #include "third_party/WebKit/Source/platform/weborigin/KURL.h" |
| 19 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
| 20 #include "wtf/Functional.h" | |
| 21 | 21 |
| 22 namespace blink { | 22 namespace blink { |
| 23 namespace { | 23 namespace { |
| 24 | 24 |
| 25 enum class LoadState { kNotLoaded, kLoadFailed, kLoadSuccessful }; | 25 enum class LoadState { kNotLoaded, kLoadFailed, kLoadSuccessful }; |
| 26 | 26 |
| 27 constexpr char kBaseUrl[] = "http://test.com/"; | 27 constexpr char kBaseUrl[] = "http://test.com/"; |
| 28 constexpr char kBaseDir[] = "notifications/"; | 28 constexpr char kBaseDir[] = "notifications/"; |
| 29 constexpr char kIcon500x500[] = "500x500.png"; | 29 constexpr char kIcon500x500[] = "500x500.png"; |
| 30 | 30 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 EXPECT_EQ(LoadState::kLoadFailed, Loaded()); | 123 EXPECT_EQ(LoadState::kLoadFailed, Loaded()); |
| 124 histogram_tester_.ExpectTotalCount("Notifications.LoadFinishTime.Icon", 0); | 124 histogram_tester_.ExpectTotalCount("Notifications.LoadFinishTime.Icon", 0); |
| 125 histogram_tester_.ExpectTotalCount("Notifications.LoadFileSize.Icon", 0); | 125 histogram_tester_.ExpectTotalCount("Notifications.LoadFileSize.Icon", 0); |
| 126 // Should log a non-zero failure time. | 126 // Should log a non-zero failure time. |
| 127 histogram_tester_.ExpectTotalCount("Notifications.LoadFailTime.Icon", 1); | 127 histogram_tester_.ExpectTotalCount("Notifications.LoadFailTime.Icon", 1); |
| 128 histogram_tester_.ExpectBucketCount("Notifications.LoadFailTime.Icon", 0, 0); | 128 histogram_tester_.ExpectBucketCount("Notifications.LoadFailTime.Icon", 0, 0); |
| 129 } | 129 } |
| 130 | 130 |
| 131 } // namspace | 131 } // namspace |
| 132 } // namespace blink | 132 } // namespace blink |
| OLD | NEW |