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

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

Issue 658923003: Remove dependency on ui from view_manager. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase 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
Index: mojo/services/public/cpp/view_manager/tests/view_unittest.cc
diff --git a/mojo/services/public/cpp/view_manager/tests/view_unittest.cc b/mojo/services/public/cpp/view_manager/tests/view_unittest.cc
index 2fb5bfc66cac5886b66eac3a9c1fd601aa61699f..87ed167626c9d2ce1aa804bc31aca037f21b66d4 100644
--- a/mojo/services/public/cpp/view_manager/tests/view_unittest.cc
+++ b/mojo/services/public/cpp/view_manager/tests/view_unittest.cc
@@ -486,9 +486,9 @@ std::string ViewIdToString(Id id) {
base::StringPrintf("%d,%d", HiWord(id), LoWord(id));
}
-std::string RectToString(const gfx::Rect& rect) {
+std::string RectToString(const Rect& rect) {
return base::StringPrintf("%d,%d %dx%d",
- rect.x(), rect.y(), rect.width(), rect.height());
+ rect.x, rect.y, rect.width, rect.height);
}
class BoundsChangeObserver : public ViewObserver {
@@ -507,8 +507,8 @@ class BoundsChangeObserver : public ViewObserver {
private:
// Overridden from ViewObserver:
void OnViewBoundsChanging(View* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) override {
+ const Rect& old_bounds,
+ const Rect& new_bounds) override {
changes_.push_back(
base::StringPrintf(
"view=%s old_bounds=%s new_bounds=%s phase=changing",
@@ -517,8 +517,8 @@ class BoundsChangeObserver : public ViewObserver {
RectToString(new_bounds).c_str()));
}
void OnViewBoundsChanged(View* view,
- const gfx::Rect& old_bounds,
- const gfx::Rect& new_bounds) override {
+ const Rect& old_bounds,
+ const Rect& new_bounds) override {
changes_.push_back(
base::StringPrintf(
"view=%s old_bounds=%s new_bounds=%s phase=changed",
@@ -539,7 +539,9 @@ TEST_F(ViewObserverTest, SetBounds) {
TestView v1;
{
BoundsChangeObserver observer(&v1);
- v1.SetBounds(gfx::Rect(0, 0, 100, 100));
+ Rect rect;
+ rect.width = rect.height = 100;
+ v1.SetBounds(rect);
Changes changes = observer.GetAndClearChanges();
ASSERT_EQ(2U, changes.size());

Powered by Google App Engine
This is Rietveld 408576698