summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 10:22:43 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-08-30 12:36:28 +0000
commit271a6c3487a14599023a9106329505597638d793 (patch)
treee040d58ffc86c1480b79ca8528020ca9ec919bf8 /chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc
parent7b2ffa587235a47d4094787d72f38102089f402a (diff)
downloadqtwebengine-chromium-271a6c3487a14599023a9106329505597638d793.tar.gz
BASELINE: Update Chromium to 77.0.3865.59
Change-Id: I1e89a5f3b009a9519a6705102ad65c92fe736f21 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc')
-rw-r--r--chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc38
1 files changed, 18 insertions, 20 deletions
diff --git a/chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc b/chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc
index b8c7f895534..367a74afb1d 100644
--- a/chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc
+++ b/chromium/third_party/blink/renderer/modules/push_messaging/push_subscription_test.cc
@@ -6,9 +6,11 @@
#include "base/stl_util.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/blink/public/platform/modules/push_messaging/web_push_subscription.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
+#include "third_party/blink/renderer/modules/push_messaging/push_subscription.h"
#include "third_party/blink/renderer/platform/bindings/string_resource.h"
+#include "third_party/blink/renderer/platform/weborigin/kurl.h"
+#include "third_party/blink/renderer/platform/wtf/vector.h"
namespace blink {
@@ -18,28 +20,24 @@ TEST(PushSubscriptionTest, SerializesToBase64URLWithoutPadding) {
// Byte value of a p256dh public key with the following base64 encoding:
// BLUVyRrO1ZGword7py9iCOCt005VKuFQQ2_ixqM30eTi97Is0_Gqc84O3qCcwb63TOkdY-
// 7WGnn1dqA3unX60eU=
- constexpr unsigned char kP256DH[] = {
- 0x04, 0xB5, 0x15, 0xC9, 0x1A, 0xCE, 0xD5, 0x91, 0xB0, 0xA2, 0xB7,
- 0x7B, 0xA7, 0x2F, 0x62, 0x08, 0xE0, 0xAD, 0xD3, 0x4E, 0x55, 0x2A,
- 0xE1, 0x50, 0x43, 0x6F, 0xE2, 0xC6, 0xA3, 0x37, 0xD1, 0xE4, 0xE2,
- 0xF7, 0xB2, 0x2C, 0xD3, 0xF1, 0xAA, 0x73, 0xCE, 0x0E, 0xDE, 0xA0,
- 0x9C, 0xC1, 0xBE, 0xB7, 0x4C, 0xE9, 0x1D, 0x63, 0xEE, 0xD6, 0x1A,
- 0x79, 0xF5, 0x76, 0xA0, 0x37, 0xBA, 0x75, 0xFA, 0xD1, 0xE5};
+ Vector<unsigned char> kP256DH(
+ {0x04, 0xB5, 0x15, 0xC9, 0x1A, 0xCE, 0xD5, 0x91, 0xB0, 0xA2, 0xB7,
+ 0x7B, 0xA7, 0x2F, 0x62, 0x08, 0xE0, 0xAD, 0xD3, 0x4E, 0x55, 0x2A,
+ 0xE1, 0x50, 0x43, 0x6F, 0xE2, 0xC6, 0xA3, 0x37, 0xD1, 0xE4, 0xE2,
+ 0xF7, 0xB2, 0x2C, 0xD3, 0xF1, 0xAA, 0x73, 0xCE, 0x0E, 0xDE, 0xA0,
+ 0x9C, 0xC1, 0xBE, 0xB7, 0x4C, 0xE9, 0x1D, 0x63, 0xEE, 0xD6, 0x1A,
+ 0x79, 0xF5, 0x76, 0xA0, 0x37, 0xBA, 0x75, 0xFA, 0xD1, 0xE5});
// Byte value of an authentication secret with the following base64 encoding:
// 6EtIXUjKlyOjRQi9oSly_A==
- constexpr unsigned char kAuthSecret[] = {0xE8, 0x4B, 0x48, 0x5D, 0x48, 0xCA,
- 0x97, 0x23, 0xA3, 0x45, 0x08, 0xBD,
- 0xA1, 0x29, 0x72, 0xFC};
-
- WebPushSubscription web_subscription(
- WebURL() /* endpoint */, true /* user_visible_only */,
- WebString() /* application_server_key */,
- WebVector<unsigned char>(kP256DH, base::size(kP256DH)),
- WebVector<unsigned char>(kAuthSecret, base::size(kAuthSecret)));
-
- PushSubscription subscription(web_subscription,
- nullptr /* service_worker_registration */);
+ Vector<unsigned char> kAuthSecret({0xE8, 0x4B, 0x48, 0x5D, 0x48, 0xCA, 0x97,
+ 0x23, 0xA3, 0x45, 0x08, 0xBD, 0xA1, 0x29,
+ 0x72, 0xFC});
+
+ PushSubscription subscription(
+ KURL() /* endpoint */, true /* user_visible_only */,
+ Vector<uint8_t>() /* application_server_key */, kP256DH, kAuthSecret,
+ nullptr /* service_worker_registration */);
ScriptValue json_object =
subscription.toJSONForBinding(v8_testing_scope.GetScriptState());