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

Unified Diff: mojo/services/view_manager/cpp/tests/view_unittest.cc

Issue 1391243003: Move //mojo/services/X/public/... to //mojo/services/X/... (part 4). (Closed) Base URL: https://github.com/domokit/mojo.git@no_public_3-x-no_public_2-x-no_public_1
Patch Set: copyright header Created 5 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
Index: mojo/services/view_manager/cpp/tests/view_unittest.cc
diff --git a/mojo/services/view_manager/public/cpp/tests/view_unittest.cc b/mojo/services/view_manager/cpp/tests/view_unittest.cc
similarity index 93%
rename from mojo/services/view_manager/public/cpp/tests/view_unittest.cc
rename to mojo/services/view_manager/cpp/tests/view_unittest.cc
index a49733c8cb4cea2af9bbcd8d94ef2dee3074192c..8c7d6dd0d1f4fc6fd4dfae70753fe71b34e4e2d4 100644
--- a/mojo/services/view_manager/public/cpp/tests/view_unittest.cc
+++ b/mojo/services/view_manager/cpp/tests/view_unittest.cc
@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "mojo/services/view_manager/public/cpp/view.h"
+#include "mojo/services/view_manager/cpp/view.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
-#include "mojo/services/view_manager/public/cpp/lib/view_private.h"
-#include "mojo/services/view_manager/public/cpp/util.h"
-#include "mojo/services/view_manager/public/cpp/view_observer.h"
-#include "mojo/services/view_manager/public/cpp/view_property.h"
+#include "mojo/services/view_manager/cpp/lib/view_private.h"
+#include "mojo/services/view_manager/cpp/util.h"
+#include "mojo/services/view_manager/cpp/view_observer.h"
+#include "mojo/services/view_manager/cpp/view_property.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
@@ -21,9 +21,7 @@ typedef testing::Test ViewTest;
// Subclass with public ctor/dtor.
class TestView : public View {
public:
- TestView() {
- ViewPrivate(this).set_id(1);
- }
+ TestView() { ViewPrivate(this).set_id(1); }
~TestView() {}
private:
@@ -191,8 +189,8 @@ typedef testing::Test ViewObserverTest;
bool TreeChangeParamsMatch(const ViewObserver::TreeChangeParams& lhs,
const ViewObserver::TreeChangeParams& rhs) {
- return lhs.target == rhs.target && lhs.old_parent == rhs.old_parent &&
- lhs.new_parent == rhs.new_parent && lhs.receiver == rhs.receiver;
+ return lhs.target == rhs.target && lhs.old_parent == rhs.old_parent &&
+ lhs.new_parent == rhs.new_parent && lhs.receiver == rhs.receiver;
}
class TreeChangeObserver : public ViewObserver {
@@ -202,9 +200,7 @@ class TreeChangeObserver : public ViewObserver {
}
~TreeChangeObserver() override { observee_->RemoveObserver(this); }
- void Reset() {
- received_params_.clear();
- }
+ void Reset() { received_params_.clear(); }
const std::vector<TreeChangeParams>& received_params() {
return received_params_;
@@ -213,9 +209,9 @@ class TreeChangeObserver : public ViewObserver {
private:
// Overridden from ViewObserver:
void OnTreeChanging(const TreeChangeParams& params) override {
- received_params_.push_back(params);
- }
- void OnTreeChanged(const TreeChangeParams& params) override {
+ received_params_.push_back(params);
+ }
+ void OnTreeChanged(const TreeChangeParams& params) override {
received_params_.push_back(params);
}
@@ -565,13 +561,13 @@ namespace {
typedef std::vector<std::string> Changes;
std::string ViewIdToString(Id id) {
- return (id == 0) ? "null" :
- base::StringPrintf("%d,%d", HiWord(id), LoWord(id));
+ return (id == 0) ? "null"
+ : base::StringPrintf("%d,%d", HiWord(id), LoWord(id));
}
std::string RectToString(const Rect& rect) {
- return base::StringPrintf("%d,%d %dx%d",
- rect.x, rect.y, rect.width, rect.height);
+ return base::StringPrintf("%d,%d %dx%d", rect.x, rect.y, rect.width,
+ rect.height);
}
class BoundsChangeObserver : public ViewObserver {
@@ -592,22 +588,18 @@ class BoundsChangeObserver : public ViewObserver {
void OnViewBoundsChanging(View* view,
const Rect& old_bounds,
const Rect& new_bounds) override {
- changes_.push_back(
- base::StringPrintf(
- "view=%s old_bounds=%s new_bounds=%s phase=changing",
- ViewIdToString(view->id()).c_str(),
- RectToString(old_bounds).c_str(),
- RectToString(new_bounds).c_str()));
+ changes_.push_back(base::StringPrintf(
+ "view=%s old_bounds=%s new_bounds=%s phase=changing",
+ ViewIdToString(view->id()).c_str(), RectToString(old_bounds).c_str(),
+ RectToString(new_bounds).c_str()));
}
void OnViewBoundsChanged(View* view,
const Rect& old_bounds,
const Rect& new_bounds) override {
- changes_.push_back(
- base::StringPrintf(
- "view=%s old_bounds=%s new_bounds=%s phase=changed",
- ViewIdToString(view->id()).c_str(),
- RectToString(old_bounds).c_str(),
- RectToString(new_bounds).c_str()));
+ changes_.push_back(base::StringPrintf(
+ "view=%s old_bounds=%s new_bounds=%s phase=changed",
+ ViewIdToString(view->id()).c_str(), RectToString(old_bounds).c_str(),
+ RectToString(new_bounds).c_str()));
}
View* view_;
@@ -830,9 +822,7 @@ typedef std::pair<const void*, intptr_t> PropertyChangeInfo;
class LocalPropertyChangeObserver : public ViewObserver {
public:
explicit LocalPropertyChangeObserver(View* view)
- : view_(view),
- property_key_(nullptr),
- old_property_value_(-1) {
+ : view_(view), property_key_(nullptr), old_property_value_(-1) {
view_->AddObserver(this);
}
~LocalPropertyChangeObserver() override { view_->RemoveObserver(this); }
@@ -877,8 +867,8 @@ TEST_F(ViewObserverTest, LocalPropertyChanged) {
EXPECT_EQ(PropertyChangeInfo(&prop, 3), o.PropertyChangeInfoAndClear());
// Sanity check to see if |PropertyChangeInfoAndClear| really clears.
- EXPECT_EQ(PropertyChangeInfo(
- reinterpret_cast<const void*>(NULL), -3), o.PropertyChangeInfoAndClear());
+ EXPECT_EQ(PropertyChangeInfo(reinterpret_cast<const void*>(NULL), -3),
+ o.PropertyChangeInfoAndClear());
}
} // namespace mojo
« no previous file with comments | « mojo/services/view_manager/cpp/tests/view_manager_test_suite.cc ('k') | mojo/services/view_manager/cpp/types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698