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

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

Issue 2654933003: platform/testing/{URL|Unit}TestHelpers improvements (Closed)
Patch Set: header changes Created 3 years, 10 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..e404d9b5e34fcc11940293072e69667b1f9e3aa3 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationResourcesLoaderTest.cpp
@@ -4,10 +4,12 @@
#include "modules/notifications/NotificationResourcesLoader.h"
+#include <memory>
#include "core/testing/DummyPageHolder.h"
#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"
@@ -19,19 +21,19 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "wtf/Functional.h"
#include "wtf/text/WTFString.h"
-#include <memory>
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