| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_TEST_JAVASCRIPT_TEST_OBSERVER_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_JAVASCRIPT_TEST_OBSERVER_H_ |
| 6 #define CONTENT_PUBLIC_TEST_JAVASCRIPT_TEST_OBSERVER_H_ | 6 #define CONTENT_PUBLIC_TEST_JAVASCRIPT_TEST_OBSERVER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // nothing timed out. | 69 // nothing timed out. |
| 70 bool Run(); | 70 bool Run(); |
| 71 | 71 |
| 72 // Prepare the observer to be used again. This method should NOT be called | 72 // Prepare the observer to be used again. This method should NOT be called |
| 73 // while Run() is pumping the message loop. | 73 // while Run() is pumping the message loop. |
| 74 void Reset(); | 74 void Reset(); |
| 75 | 75 |
| 76 virtual void Observe( | 76 virtual void Observe( |
| 77 int type, | 77 int type, |
| 78 const NotificationSource& source, | 78 const NotificationSource& source, |
| 79 const NotificationDetails& details) OVERRIDE; | 79 const NotificationDetails& details) override; |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 // This message did not signal the end of a test, keep going. | 82 // This message did not signal the end of a test, keep going. |
| 83 void Continue(); | 83 void Continue(); |
| 84 | 84 |
| 85 // This was the last message we care about, stop listening for more messages. | 85 // This was the last message we care about, stop listening for more messages. |
| 86 void EndTest(); | 86 void EndTest(); |
| 87 | 87 |
| 88 TestMessageHandler* handler_; | 88 TestMessageHandler* handler_; |
| 89 bool running_; | 89 bool running_; |
| 90 bool finished_; | 90 bool finished_; |
| 91 NotificationRegistrar registrar_; | 91 NotificationRegistrar registrar_; |
| 92 | 92 |
| 93 DISALLOW_COPY_AND_ASSIGN(JavascriptTestObserver); | 93 DISALLOW_COPY_AND_ASSIGN(JavascriptTestObserver); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace content | 96 } // namespace content |
| 97 | 97 |
| 98 #endif // CONTENT_PUBLIC_TEST_JAVASCRIPT_TEST_OBSERVER_H_ | 98 #endif // CONTENT_PUBLIC_TEST_JAVASCRIPT_TEST_OBSERVER_H_ |
| OLD | NEW |