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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1136 class MockAutofillClient : public WebAutofillClient { | 1136 class MockAutofillClient : public WebAutofillClient { |
1137 public: | 1137 public: |
1138 MockAutofillClient() | 1138 MockAutofillClient() |
1139 : m_ignoreTextChanges(false) | 1139 : m_ignoreTextChanges(false) |
1140 , m_textChangesWhileIgnored(0) | 1140 , m_textChangesWhileIgnored(0) |
1141 , m_textChangesWhileNotIgnored(0) { } | 1141 , m_textChangesWhileNotIgnored(0) { } |
1142 | 1142 |
1143 virtual ~MockAutofillClient() { } | 1143 virtual ~MockAutofillClient() { } |
1144 | 1144 |
1145 virtual void setIgnoreTextChanges(bool ignore) OVERRIDE { m_ignoreTextChange
s = ignore; } | 1145 virtual void setIgnoreTextChanges(bool ignore) OVERRIDE { m_ignoreTextChange
s = ignore; } |
1146 virtual void textFieldDidChange(const WebInputElement&) OVERRIDE | 1146 virtual void textFieldDidChange(const WebFormControlElement&) OVERRIDE |
1147 { | 1147 { |
1148 if (m_ignoreTextChanges) | 1148 if (m_ignoreTextChanges) |
1149 ++m_textChangesWhileIgnored; | 1149 ++m_textChangesWhileIgnored; |
1150 else | 1150 else |
1151 ++m_textChangesWhileNotIgnored; | 1151 ++m_textChangesWhileNotIgnored; |
1152 } | 1152 } |
1153 | 1153 |
1154 void clearChangeCounts() | 1154 void clearChangeCounts() |
1155 { | 1155 { |
1156 m_textChangesWhileIgnored = 0; | 1156 m_textChangesWhileIgnored = 0; |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1652 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); | 1652 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(false)); |
1653 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); | 1653 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); |
1654 | 1654 |
1655 // Now removing the handler in the parent document results in a no-handlers
call. | 1655 // Now removing the handler in the parent document results in a no-handlers
call. |
1656 document->didRemoveTouchEventHandler(childFrame); | 1656 document->didRemoveTouchEventHandler(childFrame); |
1657 EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(false)); | 1657 EXPECT_EQ(1, client.getAndResetHasTouchEventHandlerCallCount(false)); |
1658 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); | 1658 EXPECT_EQ(0, client.getAndResetHasTouchEventHandlerCallCount(true)); |
1659 } | 1659 } |
1660 | 1660 |
1661 } // namespace | 1661 } // namespace |
OLD | NEW |