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

Unified Diff: mojo/public/cpp/bindings/tests/array_unittest.cc

Issue 611633002: mojom: Add associative arrays to the mojom language. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved test classes to their own shared file. Created 6 years, 2 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
« no previous file with comments | « mojo/public/cpp/bindings/tests/BUILD.gn ('k') | mojo/public/cpp/bindings/tests/container_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/tests/array_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/array_unittest.cc b/mojo/public/cpp/bindings/tests/array_unittest.cc
index b899513bf5385ae1fe3be66eb95753b92c116e1e..133fa8b32436c455b6bc8a6d779bc2d36b8a9b11 100644
--- a/mojo/public/cpp/bindings/tests/array_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/array_unittest.cc
@@ -6,6 +6,7 @@
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/array_serialization.h"
#include "mojo/public/cpp/bindings/lib/fixed_buffer.h"
+#include "mojo/public/cpp/bindings/tests/container_test_util.h"
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/interfaces/bindings/tests/test_structs.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -20,60 +21,6 @@ using mojo::internal::FixedBuffer;
using mojo::internal::NoValidateParams;
using mojo::internal::String_Data;
-class CopyableType {
- public:
- CopyableType() : copied_(false), ptr_(this) { num_instances_++; }
- CopyableType(const CopyableType& other) : copied_(true), ptr_(other.ptr()) {
- num_instances_++;
- }
- CopyableType& operator=(const CopyableType& other) {
- copied_ = true;
- ptr_ = other.ptr();
- return *this;
- }
- ~CopyableType() { num_instances_--; }
-
- bool copied() const { return copied_; }
- static size_t num_instances() { return num_instances_; }
- CopyableType* ptr() const { return ptr_; }
- void ResetCopied() { copied_ = false; }
-
- private:
- bool copied_;
- static size_t num_instances_;
- CopyableType* ptr_;
-};
-
-size_t CopyableType::num_instances_ = 0;
-
-class MoveOnlyType {
- MOJO_MOVE_ONLY_TYPE_FOR_CPP_03(MoveOnlyType, RValue)
- public:
- typedef MoveOnlyType Data_;
- MoveOnlyType() : moved_(false), ptr_(this) { num_instances_++; }
- MoveOnlyType(RValue other) : moved_(true), ptr_(other.object->ptr()) {
- num_instances_++;
- }
- MoveOnlyType& operator=(RValue other) {
- moved_ = true;
- ptr_ = other.object->ptr();
- return *this;
- }
- ~MoveOnlyType() { num_instances_--; }
-
- bool moved() const { return moved_; }
- static size_t num_instances() { return num_instances_; }
- MoveOnlyType* ptr() const { return ptr_; }
- void ResetMoved() { moved_ = false; }
-
- private:
- bool moved_;
- static size_t num_instances_;
- MoveOnlyType* ptr_;
-};
-
-size_t MoveOnlyType::num_instances_ = 0;
-
class ArrayTest : public testing::Test {
public:
virtual ~ArrayTest() {}
« no previous file with comments | « mojo/public/cpp/bindings/tests/BUILD.gn ('k') | mojo/public/cpp/bindings/tests/container_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698