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

Unified Diff: content/child/background_sync/background_sync_type_converters_unittest.cc

Issue 2473483012: Move content/child/background_sync to Blink. (Closed)
Patch Set: Fix nits Created 4 years, 1 month 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: content/child/background_sync/background_sync_type_converters_unittest.cc
diff --git a/content/child/background_sync/background_sync_type_converters_unittest.cc b/content/child/background_sync/background_sync_type_converters_unittest.cc
deleted file mode 100644
index b822bdf53ffde9fc6099c395e05575e5177bb258..0000000000000000000000000000000000000000
--- a/content/child/background_sync/background_sync_type_converters_unittest.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-
-// Copyright 2015 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 "content/child/background_sync/background_sync_type_converters.h"
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace mojo {
-namespace {
-
-TEST(BackgroundSyncTypeConverterTest, TestBlinkToMojoNetworkStateConversions) {
- ASSERT_EQ(blink::WebSyncRegistration::NetworkStateAny,
- ConvertTo<blink::WebSyncRegistration::NetworkState>(
- blink::mojom::BackgroundSyncNetworkState::ANY));
- ASSERT_EQ(blink::WebSyncRegistration::NetworkStateAvoidCellular,
- ConvertTo<blink::WebSyncRegistration::NetworkState>(
- blink::mojom::BackgroundSyncNetworkState::AVOID_CELLULAR));
- ASSERT_EQ(blink::WebSyncRegistration::NetworkStateOnline,
- ConvertTo<blink::WebSyncRegistration::NetworkState>(
- blink::mojom::BackgroundSyncNetworkState::ONLINE));
-}
-
-TEST(BackgroundSyncTypeConverterTest, TestMojoToBlinkNetworkStateConversions) {
- ASSERT_EQ(blink::mojom::BackgroundSyncNetworkState::ANY,
- ConvertTo<blink::mojom::BackgroundSyncNetworkState>(
- blink::WebSyncRegistration::NetworkStateAny));
- ASSERT_EQ(blink::mojom::BackgroundSyncNetworkState::AVOID_CELLULAR,
- ConvertTo<blink::mojom::BackgroundSyncNetworkState>(
- blink::WebSyncRegistration::NetworkStateAvoidCellular));
- ASSERT_EQ(blink::mojom::BackgroundSyncNetworkState::ONLINE,
- ConvertTo<blink::mojom::BackgroundSyncNetworkState>(
- blink::WebSyncRegistration::NetworkStateOnline));
-}
-
-TEST(BackgroundSyncTypeConverterTest, TestDefaultBlinkToMojoConversion) {
- blink::WebSyncRegistration in;
- blink::mojom::SyncRegistrationPtr out =
- ConvertTo<blink::mojom::SyncRegistrationPtr>(in);
-
- ASSERT_EQ(blink::WebSyncRegistration::UNREGISTERED_SYNC_ID, out->id);
- ASSERT_EQ("", out->tag);
- ASSERT_EQ(blink::mojom::BackgroundSyncNetworkState::ONLINE,
- out->network_state);
-}
-
-TEST(BackgroundSyncTypeConverterTest, TestFullBlinkToMojoConversion) {
- blink::WebSyncRegistration in(
- 7, "BlinkToMojo", blink::WebSyncRegistration::NetworkStateAvoidCellular);
- blink::mojom::SyncRegistrationPtr out =
- ConvertTo<blink::mojom::SyncRegistrationPtr>(in);
-
- ASSERT_EQ(7, out->id);
- ASSERT_EQ("BlinkToMojo", out->tag);
- ASSERT_EQ(blink::mojom::BackgroundSyncNetworkState::AVOID_CELLULAR,
- out->network_state);
-}
-
-TEST(BackgroundSyncTypeConverterTest, TestDefaultMojoToBlinkConversion) {
- blink::mojom::SyncRegistrationPtr in(blink::mojom::SyncRegistration::New());
- std::unique_ptr<blink::WebSyncRegistration> out =
- ConvertTo<std::unique_ptr<blink::WebSyncRegistration>>(in);
-
- ASSERT_EQ(blink::WebSyncRegistration::UNREGISTERED_SYNC_ID, out->id);
- ASSERT_EQ("",out->tag);
- ASSERT_EQ(blink::WebSyncRegistration::NetworkStateOnline, out->networkState);
-}
-
-TEST(BackgroundSyncTypeConverterTest, TestFullMojoToBlinkConversion) {
- blink::mojom::SyncRegistrationPtr in(blink::mojom::SyncRegistration::New());
- in->id = 41;
- in->tag = mojo::String("MojoToBlink");
- in->network_state = blink::mojom::BackgroundSyncNetworkState::AVOID_CELLULAR;
- std::unique_ptr<blink::WebSyncRegistration> out =
- ConvertTo<std::unique_ptr<blink::WebSyncRegistration>>(in);
-
- ASSERT_EQ(41, out->id);
- ASSERT_EQ("MojoToBlink", out->tag.utf8());
- ASSERT_EQ(blink::WebSyncRegistration::NetworkStateAvoidCellular,
- out->networkState);
-}
-
-} // anonymous namespace
-} // namespace mojo
-
« no previous file with comments | « content/child/background_sync/background_sync_type_converters.cc ('k') | content/child/blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698