OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1122 class MockAutofillClient : public WebAutofillClient { | 1122 class MockAutofillClient : public WebAutofillClient { |
1123 public: | 1123 public: |
1124 MockAutofillClient() | 1124 MockAutofillClient() |
1125 : m_ignoreTextChanges(false) | 1125 : m_ignoreTextChanges(false) |
1126 , m_textChangesWhileIgnored(0) | 1126 , m_textChangesWhileIgnored(0) |
1127 , m_textChangesWhileNotIgnored(0) { } | 1127 , m_textChangesWhileNotIgnored(0) { } |
1128 | 1128 |
1129 virtual ~MockAutofillClient() { } | 1129 virtual ~MockAutofillClient() { } |
1130 | 1130 |
1131 virtual void setIgnoreTextChanges(bool ignore) OVERRIDE { m_ignoreTextChange s = ignore; } | 1131 virtual void setIgnoreTextChanges(bool ignore) OVERRIDE { m_ignoreTextChange s = ignore; } |
1132 // TODO(ziran.sun): This function is to be removed once both chromium and bl ink changes | |
tkent
2014/03/05 23:18:39
TODO() -> FIXME
| |
1133 // for BUG332557 are in. | |
1132 virtual void textFieldDidChange(const WebInputElement&) OVERRIDE | 1134 virtual void textFieldDidChange(const WebInputElement&) OVERRIDE |
1133 { | 1135 { |
1134 if (m_ignoreTextChanges) | 1136 if (m_ignoreTextChanges) |
1135 ++m_textChangesWhileIgnored; | 1137 ++m_textChangesWhileIgnored; |
1136 else | 1138 else |
1137 ++m_textChangesWhileNotIgnored; | 1139 ++m_textChangesWhileNotIgnored; |
1138 } | 1140 } |
1141 virtual void textFieldDidChange(const WebFormControlElement&) OVERRIDE | |
1142 { | |
1143 if (m_ignoreTextChanges) | |
1144 ++m_textChangesWhileIgnored; | |
1145 else | |
1146 ++m_textChangesWhileNotIgnored; | |
1147 } | |
1139 | 1148 |
1140 void clearChangeCounts() | 1149 void clearChangeCounts() |
1141 { | 1150 { |
1142 m_textChangesWhileIgnored = 0; | 1151 m_textChangesWhileIgnored = 0; |
1143 m_textChangesWhileNotIgnored = 0; | 1152 m_textChangesWhileNotIgnored = 0; |
1144 } | 1153 } |
1145 | 1154 |
1146 int textChangesWhileIgnored() { return m_textChangesWhileIgnored; } | 1155 int textChangesWhileIgnored() { return m_textChangesWhileIgnored; } |
1147 int textChangesWhileNotIgnored() { return m_textChangesWhileNotIgnored; } | 1156 int textChangesWhileNotIgnored() { return m_textChangesWhileNotIgnored; } |
1148 | 1157 |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1638 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); | 1647 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); |
1639 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); | 1648 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); |
1640 | 1649 |
1641 // Now removing the handler in the parent document results in a no-handlers call. | 1650 // Now removing the handler in the parent document results in a no-handlers call. |
1642 document->didRemoveTouchEventHandler(childFrame); | 1651 document->didRemoveTouchEventHandler(childFrame); |
1643 EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(false)); | 1652 EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(false)); |
1644 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); | 1653 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); |
1645 } | 1654 } |
1646 | 1655 |
1647 } // namespace | 1656 } // namespace |
OLD | NEW |