~feng-kylin/unity/changeTopLabel

« back to all changes in this revision

Viewing changes to tests/test_unity_window_view.cpp

  • Committer: CI bot
  • Author(s): Brandon Schaefer, Brandon Schaefer
  • Date: 2014-06-06 13:54:47 UTC
  • mfrom: (3788.4.14 shutdown-dialog-hi-dpi)
  • Revision ID: ps-jenkins@lists.canonical.com-20140606135447-1vh7zwtcbk4vwzx3
ShutdownView: Scale up the Buttons and Text plus Borders of the UnityWindowView. Fixes: 1308323

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
  view.closable = true;
83
83
  ASSERT_NE(view.close_button_, nullptr);
84
84
 
85
 
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetCloseIcon());
 
85
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON));
86
86
  EXPECT_EQ(view.close_button_->GetParentObject(), &view);
87
87
 
88
 
  int padding = view.style()->GetCloseButtonPadding();
 
88
  int padding = view.style()->GetCloseButtonPadding(view.scale);
89
89
  EXPECT_EQ(view.close_button_->GetBaseX(), padding);
90
90
  EXPECT_EQ(view.close_button_->GetBaseY(), padding);
91
91
}
96
96
  ASSERT_NE(view.close_button_, nullptr);
97
97
 
98
98
  view.close_button_->mouse_enter.emit(0, 0, 0, 0);
99
 
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetCloseIconHighligted());
 
99
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON_HIGHLIGHTED));
100
100
 
101
101
  view.close_button_->mouse_leave.emit(0, 0, 0, 0);
102
 
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetCloseIcon());
 
102
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON));
103
103
 
104
104
  view.close_button_->mouse_down.emit(0, 0, 0, 0);
105
 
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetCloseIconPressed());
 
105
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON_PRESSED));
106
106
 
107
107
  view.close_button_->mouse_up.emit(0, 0, 0, 0);
108
 
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetCloseIcon());
 
108
  EXPECT_EQ(view.close_button_->texture(), view.style()->GetTexture(view.scale, WindowTextureType::CLOSE_ICON));
109
109
}
110
110
 
111
111
TEST_F(TestUnityWindowView, CloseButtonClicksRequestsClose)
185
185
  view.SetLayout(layout);
186
186
  view.ComputeContentSize();
187
187
 
188
 
  int offset = view.style()->GetInternalOffset();
 
188
  int offset = view.style()->GetInternalOffset(view.scale);
189
189
  EXPECT_EQ(layout->GetBaseX(), offset);
190
190
  EXPECT_EQ(layout->GetBaseY(), offset);
191
191
}
199
199
 
200
200
TEST_F(TestUnityWindowView, GetInternalBackground)
201
201
{
202
 
  int offset = view.style()->GetInternalOffset();
 
202
  int offset = view.style()->GetInternalOffset(view.scale);
203
203
  view.background_geo_.Set(g_random_int(), g_random_int(), g_random_int(), g_random_int());
204
204
  EXPECT_EQ(view.GetInternalBackground(), view.background_geo_.GetExpand(-offset, -offset));
205
205
}
240
240
}
241
241
 
242
242
} // ui
243
 
} // unity
 
 
b'\\ No newline at end of file'
 
243
} // unity