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

Unified Diff: chrome/browser/services/gcm/push_messaging_application_id_unittest.cc

Issue 955673004: Move gcm-independent parts of push messaging out of gcm namespace and directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove redundant cast Created 5 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: chrome/browser/services/gcm/push_messaging_application_id_unittest.cc
diff --git a/chrome/browser/services/gcm/push_messaging_application_id_unittest.cc b/chrome/browser/services/gcm/push_messaging_application_id_unittest.cc
deleted file mode 100644
index 34944db55cf3fbad17d79179f625ea552df98130..0000000000000000000000000000000000000000
--- a/chrome/browser/services/gcm/push_messaging_application_id_unittest.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/services/gcm/push_messaging_application_id.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace gcm {
-
-class PushMessagingApplicationIdTest : public testing::Test {
- protected:
- PushMessagingApplicationId GenerateId(
- const GURL& origin,
- int64 service_worker_registration_id) {
- // To bypass DCHECK in PushMessagingApplicationId::Generate, we just use it
- // to generate app_id_guid, and then use private constructor.
- std::string app_id_guid = gcm::PushMessagingApplicationId::Generate(
- GURL("https://www.example.com/"), 1).app_id_guid();
- return PushMessagingApplicationId(app_id_guid, origin,
- service_worker_registration_id);
- }
-};
-
-TEST_F(PushMessagingApplicationIdTest, ConstructorValidity) {
- EXPECT_TRUE(GenerateId(GURL("https://www.example.com/"), 1).IsValid());
- EXPECT_TRUE(GenerateId(GURL("https://www.example.com"), 1).IsValid());
- EXPECT_FALSE(GenerateId(GURL(""), 1).IsValid());
- EXPECT_FALSE(GenerateId(GURL("foo"), 1).IsValid());
- EXPECT_FALSE(GenerateId(GURL("https://www.example.com/foo"), 1).IsValid());
- EXPECT_FALSE(GenerateId(GURL("https://www.example.com/#foo"), 1).IsValid());
- EXPECT_FALSE(GenerateId(GURL("https://www.example.com/"), -1).IsValid());
-}
-
-TEST_F(PushMessagingApplicationIdTest, UniqueGuids) {
- EXPECT_NE(gcm::PushMessagingApplicationId::Generate(
- GURL("https://www.example.com/"), 1).app_id_guid(),
- gcm::PushMessagingApplicationId::Generate(
- GURL("https://www.example.com/"), 1).app_id_guid());
-}
-
-} // namespace gcm

Powered by Google App Engine
This is Rietveld 408576698