This source file includes following definitions.
- TEST_F
#include "chrome/browser/ui/libgtk2ui/x11_input_method_context_impl_gtk2.h"
#include "base/strings/utf_string_conversions.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace libgtk2ui {
class X11InputMethodContextImplGtk2FriendTest : public testing::Test {
};
TEST_F(X11InputMethodContextImplGtk2FriendTest, GtkCommitSignalTrap) {
libgtk2ui::X11InputMethodContextImplGtk2::GtkCommitSignalTrap trap;
EXPECT_FALSE(trap.IsSignalCaught());
EXPECT_FALSE(trap.Trap(base::string16()));
EXPECT_FALSE(trap.IsSignalCaught());
trap.StartTrap('t');
EXPECT_FALSE(trap.Trap(base::UTF8ToUTF16("T")));
EXPECT_FALSE(trap.IsSignalCaught());
EXPECT_FALSE(trap.Trap(base::UTF8ToUTF16("true")));
EXPECT_FALSE(trap.IsSignalCaught());
trap.StopTrap();
EXPECT_FALSE(trap.Trap(base::UTF8ToUTF16("t")));
EXPECT_FALSE(trap.IsSignalCaught());
trap.StopTrap();
trap.StopTrap();
EXPECT_FALSE(trap.Trap(base::UTF8ToUTF16("t")));
EXPECT_FALSE(trap.IsSignalCaught());
trap.StartTrap('f');
trap.StartTrap('t');
EXPECT_TRUE(trap.Trap(base::UTF8ToUTF16("t")));
EXPECT_TRUE(trap.IsSignalCaught());
trap.StartTrap('t');
EXPECT_FALSE(trap.IsSignalCaught());
EXPECT_FALSE(trap.Trap(base::UTF8ToUTF16("f")));
EXPECT_FALSE(trap.IsSignalCaught());
EXPECT_TRUE(trap.Trap(base::UTF8ToUTF16("t")));
EXPECT_TRUE(trap.IsSignalCaught());
}
}