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

Unified Diff: services/clipboard/clipboard_apptest.cc

Issue 768683003: Switch clipboard_unittests to clipboard_apptests. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oneliners Created 6 years 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
« no previous file with comments | « services/clipboard/BUILD.gn ('k') | services/clipboard/clipboard_standalone_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/clipboard/clipboard_apptest.cc
diff --git a/services/clipboard/clipboard_standalone_unittest.cc b/services/clipboard/clipboard_apptest.cc
similarity index 84%
rename from services/clipboard/clipboard_standalone_unittest.cc
rename to services/clipboard/clipboard_apptest.cc
index c23aad249cfc77d3dad5e137a9b2e0f0e11d96c3..2e7888864fed7cbb4546f7fc9fb626662804893b 100644
--- a/services/clipboard/clipboard_standalone_unittest.cc
+++ b/services/clipboard/clipboard_apptest.cc
@@ -2,13 +2,12 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/at_exit.h"
#include "base/bind.h"
-#include "base/macros.h"
+#include "base/run_loop.h"
#include "mojo/common/common_type_converters.h"
+#include "mojo/public/cpp/application/application_impl.h"
+#include "mojo/public/cpp/application/application_test_base.h"
#include "mojo/services/public/interfaces/clipboard/clipboard.mojom.h"
-#include "mojo/shell/shell_test_helper.h"
-#include "testing/gtest/include/gtest/gtest.h"
namespace {
@@ -44,16 +43,14 @@ const char* kHtmlData = "<html>data</html>";
namespace mojo {
namespace service {
-class ClipboardStandaloneTest : public testing::Test {
+class ClipboardAppTest : public test::ApplicationTestBase {
public:
- ClipboardStandaloneTest() {}
- ~ClipboardStandaloneTest() override {}
+ ClipboardAppTest() : ApplicationTestBase() {}
+ ~ClipboardAppTest() override {}
void SetUp() override {
- test_helper_.Init();
-
- test_helper_.application_manager()->ConnectToService(GURL("mojo:clipboard"),
- &clipboard_);
+ ApplicationTestBase::SetUp();
+ application_impl()->ConnectToService("mojo:clipboard", &clipboard_);
}
uint64_t GetSequenceNumber() {
@@ -96,22 +93,19 @@ class ClipboardStandaloneTest : public testing::Test {
}
protected:
- base::ShadowingAtExitManager at_exit_;
- shell::ShellTestHelper test_helper_;
-
ClipboardPtr clipboard_;
- DISALLOW_COPY_AND_ASSIGN(ClipboardStandaloneTest);
+ DISALLOW_COPY_AND_ASSIGN(ClipboardAppTest);
};
-TEST_F(ClipboardStandaloneTest, EmptyClipboardOK) {
+TEST_F(ClipboardAppTest, EmptyClipboardOK) {
EXPECT_EQ(0ul, GetSequenceNumber());
EXPECT_TRUE(GetAvailableFormatMimeTypes().empty());
std::string data;
EXPECT_FALSE(GetDataOfType(mojo::Clipboard::MIME_TYPE_TEXT, &data));
}
-TEST_F(ClipboardStandaloneTest, CanReadBackText) {
+TEST_F(ClipboardAppTest, CanReadBackText) {
std::string data;
EXPECT_FALSE(GetDataOfType(mojo::Clipboard::MIME_TYPE_TEXT, &data));
EXPECT_EQ(0ul, GetSequenceNumber());
@@ -123,7 +117,7 @@ TEST_F(ClipboardStandaloneTest, CanReadBackText) {
EXPECT_EQ(kPlainTextData, data);
}
-TEST_F(ClipboardStandaloneTest, CanSetMultipleDataTypesAtOnce) {
+TEST_F(ClipboardAppTest, CanSetMultipleDataTypesAtOnce) {
Map<String, Array<uint8_t>> mime_data;
mime_data[mojo::Clipboard::MIME_TYPE_TEXT] =
Array<uint8_t>::From(std::string(kPlainTextData));
@@ -142,7 +136,7 @@ TEST_F(ClipboardStandaloneTest, CanSetMultipleDataTypesAtOnce) {
EXPECT_EQ(kHtmlData, data);
}
-TEST_F(ClipboardStandaloneTest, CanClearClipboardWithZeroArray) {
+TEST_F(ClipboardAppTest, CanClearClipboardWithZeroArray) {
std::string data;
SetStringText(kPlainTextData);
EXPECT_EQ(1ul, GetSequenceNumber());
« no previous file with comments | « services/clipboard/BUILD.gn ('k') | services/clipboard/clipboard_standalone_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698