Fix Win 64-bit conversion from 'size_t' to 'int' error (issue #1887)

This commit is contained in:
Marshall Greenblatt 2016-05-09 14:49:17 -04:00
parent da3c6a3b61
commit 157f526d07
1 changed files with 13 additions and 6 deletions

View File

@ -47,10 +47,13 @@ void TextfieldContentsImpl() {
// Test select range.
EXPECT_FALSE(textfield->HasSelection());
EXPECT_EQ(CefRange(cursor_pos, cursor_pos), textfield->GetSelectedRange());
textfield->SelectRange(CefRange(0, cursor_pos));
EXPECT_EQ(CefRange(static_cast<int>(cursor_pos),
static_cast<int>(cursor_pos)),
textfield->GetSelectedRange());
textfield->SelectRange(CefRange(0, static_cast<int>(cursor_pos)));
EXPECT_TRUE(textfield->HasSelection());
EXPECT_EQ(CefRange(0, cursor_pos), textfield->GetSelectedRange());
EXPECT_EQ(CefRange(0, static_cast<int>(cursor_pos)),
textfield->GetSelectedRange());
EXPECT_STREQ(kText, textfield->GetSelectedText().ToString().c_str());
EXPECT_EQ(cursor_pos, textfield->GetCursorPosition());
@ -69,20 +72,24 @@ void TextfieldContentsImpl() {
EXPECT_TRUE(textfield->HasSelection());
cursor_pos = sizeof(kReplaceText) + sizeof(kAppendText) - 2;
EXPECT_EQ(CefRange(0, cursor_pos), textfield->GetSelectedRange());
EXPECT_EQ(CefRange(0, static_cast<int>(cursor_pos)),
textfield->GetSelectedRange());
EXPECT_EQ(cursor_pos, textfield->GetCursorPosition());
// Test clear selection.
textfield->ClearSelection();
EXPECT_FALSE(textfield->HasSelection());
EXPECT_EQ(CefRange(cursor_pos, cursor_pos), textfield->GetSelectedRange());
EXPECT_EQ(CefRange(static_cast<int>(cursor_pos),
static_cast<int>(cursor_pos)),
textfield->GetSelectedRange());
EXPECT_EQ(cursor_pos, textfield->GetCursorPosition());
// Test selection with command.
EXPECT_TRUE(textfield->IsCommandEnabled(IDS_APP_SELECT_ALL));
textfield->ExecuteCommand(IDS_APP_SELECT_ALL);
EXPECT_TRUE(textfield->HasSelection());
EXPECT_EQ(CefRange(0, cursor_pos), textfield->GetSelectedRange());
EXPECT_EQ(CefRange(0, static_cast<int>(cursor_pos)),
textfield->GetSelectedRange());
EXPECT_EQ(cursor_pos, textfield->GetCursorPosition());
textfield->ClearEditHistory();