Skip to content

Commit

Permalink
Fix tests that were committed after cirrus ran (#7819)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryQian committed Feb 14, 2019
1 parent 1f2cbf7 commit af39e22
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions third_party/txt/tests/paragraph_unittests.cc
Expand Up @@ -638,32 +638,32 @@ TEST_F(ParagraphTest, DISABLE_ON_WINDOWS(JustifyAlignParagraph)) {
ASSERT_EQ(paragraph->runs_.runs_.size(), 1ull);
ASSERT_EQ(paragraph->runs_.styles_.size(), 2ull);
ASSERT_TRUE(paragraph->runs_.styles_[1].equals(text_style));
ASSERT_EQ(paragraph->records_.size(), paragraph_style.max_lines);
ASSERT_EQ(paragraph->records_.size(), 27ull);
double expected_y = 24;

ASSERT_TRUE(paragraph->records_[0].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[0].offset().y(), expected_y);
expected_y += 30;
ASSERT_DOUBLE_EQ(paragraph->records_[0].offset().x(), 0);

ASSERT_TRUE(paragraph->records_[1].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[1].offset().y(), expected_y);
expected_y += 30;
ASSERT_DOUBLE_EQ(paragraph->records_[1].offset().x(), 0);

ASSERT_TRUE(paragraph->records_[2].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[2].offset().y(), expected_y);
expected_y += 30;
ASSERT_DOUBLE_EQ(paragraph->records_[2].offset().x(), 0);

ASSERT_TRUE(paragraph->records_[3].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[3].offset().y(), expected_y);
ASSERT_TRUE(paragraph->records_[4].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[4].offset().y(), expected_y);
expected_y += 30;
ASSERT_DOUBLE_EQ(paragraph->records_[4].offset().x(), 0);

ASSERT_TRUE(paragraph->records_[6].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[6].offset().y(), expected_y);
expected_y += 30 * 10;
ASSERT_DOUBLE_EQ(paragraph->records_[3].offset().x(), 0);
ASSERT_DOUBLE_EQ(paragraph->records_[6].offset().x(), 0);

ASSERT_TRUE(paragraph->records_[13].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[13].offset().y(), expected_y);
ASSERT_DOUBLE_EQ(paragraph->records_[13].offset().x(), 0);
ASSERT_TRUE(paragraph->records_[26].style().equals(text_style));
ASSERT_DOUBLE_EQ(paragraph->records_[26].offset().y(), expected_y);
ASSERT_DOUBLE_EQ(paragraph->records_[26].offset().x(), 0);

ASSERT_EQ(paragraph_style.text_align,
paragraph->GetParagraphStyle().text_align);
Expand Down Expand Up @@ -706,7 +706,11 @@ TEST_F(ParagraphTest, DISABLE_ON_WINDOWS(JustifyRTL)) {
ASSERT_TRUE(Snapshot());

auto glyph_line_width = [&paragraph](int index) {
return paragraph->glyph_lines_[index].positions.back().x_pos.end;
size_t second_to_last_position_index =
paragraph->glyph_lines_[index].positions.size() - 2;
return paragraph->glyph_lines_[index]
.positions[second_to_last_position_index]
.x_pos.end;
};

// All lines except the last should be justified to the width of the
Expand Down

0 comments on commit af39e22

Please sign in to comment.