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

Unified Diff: third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp

Issue 2133673002: Push API: Implement and ship PushSubscription.options (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add MODULES_EXPORT Created 4 years, 5 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/push_messaging/PushManagerTest.cpp
diff --git a/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp b/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp
index 0511cb21984d2ddea206be5161a3341beda53f5a..590b7672fcc58c46cd5e6e9d79b8ff99ae930500 100644
--- a/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp
+++ b/third_party/WebKit/Source/modules/push_messaging/PushManagerTest.cpp
@@ -6,6 +6,7 @@
#include "core/dom/DOMArrayBuffer.h"
#include "modules/push_messaging/PushSubscriptionOptions.h"
+#include "modules/push_messaging/PushSubscriptionOptionsInit.h"
#include "public/platform/WebString.h"
#include "public/platform/modules/push_messaging/WebPushSubscriptionOptions.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -28,13 +29,13 @@ const uint8_t kApplicationServerKey[kApplicationServerKeyLength] = {
TEST(PushManagerTest, ValidSenderKey)
{
- PushSubscriptionOptions options;
+ PushSubscriptionOptionsInit options;
options.setApplicationServerKey(
ArrayBufferOrArrayBufferView::fromArrayBuffer(
DOMArrayBuffer::create(kApplicationServerKey, kApplicationServerKeyLength)));
TrackExceptionState exceptionState;
- WebPushSubscriptionOptions output = PushManager::toWebPushSubscriptionOptions(options, exceptionState);
+ WebPushSubscriptionOptions output = PushSubscriptionOptions::toWeb(options, exceptionState);
EXPECT_FALSE(exceptionState.hadException());
EXPECT_EQ(output.applicationServerKey.length(), kApplicationServerKeyLength);
@@ -52,13 +53,13 @@ TEST(PushManagerTest, InvalidSenderKeyLength)
{
uint8_t senderKey[kMaxKeyLength + 1];
memset(senderKey, 0, sizeof(senderKey));
- PushSubscriptionOptions options;
+ PushSubscriptionOptionsInit options;
options.setApplicationServerKey(
ArrayBufferOrArrayBufferView::fromArrayBuffer(
DOMArrayBuffer::create(senderKey, kMaxKeyLength + 1)));
TrackExceptionState exceptionState;
- WebPushSubscriptionOptions output = PushManager::toWebPushSubscriptionOptions(options, exceptionState);
+ WebPushSubscriptionOptions output = PushSubscriptionOptions::toWeb(options, exceptionState);
EXPECT_TRUE(exceptionState.hadException());
}

Powered by Google App Engine
This is Rietveld 408576698