Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(765)

Unified Diff: third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: cleanup Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
index a32e0b17e6744b75fef9f836242d1aa15281a80f..aaa15ce122260c5e478dc256d630f77e822960c5 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
@@ -8,6 +8,7 @@
#include "platform/heap/Heap.h"
#include "platform/loader/fetch/MemoryCache.h"
#include "platform/testing/URLTestHelpers.h"
+#include "platform/testing/UnitTestHelpers.h"
#include "platform/weborigin/KURL.h"
#include "public/platform/Platform.h"
#include "public/platform/WebURL.h"
@@ -24,14 +25,15 @@
namespace blink {
namespace {
-const char kBaseUrl[] = "http://test.com/";
-const char kIcon48x48[] = "48x48.png";
-const char kIcon100x100[] = "100x100.png";
-const char kIcon110x110[] = "110x110.png";
-const char kIcon120x120[] = "120x120.png";
-const char kIcon500x500[] = "500x500.png";
-const char kIcon3000x1000[] = "3000x1000.png";
-const char kIcon3000x2000[] = "3000x2000.png";
+constexpr char kBaseUrl[] = "http://test.com/";
+constexpr char kBaseDir[] = "notifications/";
+constexpr char kIcon48x48[] = "48x48.png";
+constexpr char kIcon100x100[] = "100x100.png";
+constexpr char kIcon110x110[] = "110x110.png";
+constexpr char kIcon120x120[] = "120x120.png";
+constexpr char kIcon500x500[] = "500x500.png";
+constexpr char kIcon3000x1000[] = "3000x1000.png";
+constexpr char kIcon3000x2000[] = "3000x2000.png";
class NotificationResourcesLoaderTest : public ::testing::Test {
public:
@@ -61,12 +63,9 @@ class NotificationResourcesLoaderTest : public ::testing::Test {
// Registers a mocked url. When fetched, |fileName| will be loaded from the
// test data directory.
WebURL registerMockedURL(const String& fileName) {
- WebURL url(KURL(ParsedURLString, kBaseUrl + fileName));
-
- URLTestHelpers::registerMockedURLLoad(url, fileName, "notifications/",
- "image/png");
-
- return url;
+ WebURL registeredUrl = URLTestHelpers::registerMockedURLLoadFromBase(
+ kBaseUrl, testing::webTestDataPath(kBaseDir), fileName, "image/png");
+ return registeredUrl;
}
// Registers a mocked url that will fail to be fetched, with a 404 error.

Powered by Google App Engine
This is Rietveld 408576698