Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: chrome/browser/extensions/extension_test_message_listener.h

Issue 7064033: Virtual destructors should have virtual keyword. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_MESSAGE_LISTENER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_MESSAGE_LISTENER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_MESSAGE_LISTENER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_MESSAGE_LISTENER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
(...skipping 29 matching lines...) Expand all
40 // Note that when using it in browser tests, you need to make sure it gets 40 // Note that when using it in browser tests, you need to make sure it gets
41 // destructed *before* the browser gets torn down. Two common patterns are to 41 // destructed *before* the browser gets torn down. Two common patterns are to
42 // either make it a local variable inside your test body, or if it's a member 42 // either make it a local variable inside your test body, or if it's a member
43 // variable of a ExtensionBrowserTest subclass, override the 43 // variable of a ExtensionBrowserTest subclass, override the
44 // InProcessBrowserTest::CleanUpOnMainThread() method and clean it up there. 44 // InProcessBrowserTest::CleanUpOnMainThread() method and clean it up there.
45 class ExtensionTestMessageListener : public NotificationObserver { 45 class ExtensionTestMessageListener : public NotificationObserver {
46 public: 46 public:
47 // We immediately start listening for |expected_message|. 47 // We immediately start listening for |expected_message|.
48 ExtensionTestMessageListener(const std::string& expected_message, 48 ExtensionTestMessageListener(const std::string& expected_message,
49 bool will_reply); 49 bool will_reply);
50 ~ExtensionTestMessageListener(); 50 virtual ~ExtensionTestMessageListener();
51 51
52 // This returns true immediately if we've already gotten the expected 52 // This returns true immediately if we've already gotten the expected
53 // message, or waits until it arrives. Returns false if the wait is 53 // message, or waits until it arrives. Returns false if the wait is
54 // interrupted and we still haven't gotten the message. 54 // interrupted and we still haven't gotten the message.
55 bool WaitUntilSatisfied(); 55 bool WaitUntilSatisfied();
56 56
57 // Send the given message as a reply. It is only valid to call this after 57 // Send the given message as a reply. It is only valid to call this after
58 // WaitUntilSatisfied has returned true, and if will_reply is true. 58 // WaitUntilSatisfied has returned true, and if will_reply is true.
59 void Reply(const std::string& message); 59 void Reply(const std::string& message);
60 60
(...skipping 19 matching lines...) Expand all
80 80
81 // If true, we expect the calling code to manually send a reply. Otherwise, 81 // If true, we expect the calling code to manually send a reply. Otherwise,
82 // we send an automatic empty reply to the extension. 82 // we send an automatic empty reply to the extension.
83 bool will_reply_; 83 bool will_reply_;
84 84
85 // The function we need to reply to. 85 // The function we need to reply to.
86 ExtensionTestSendMessageFunction* function_; 86 ExtensionTestSendMessageFunction* function_;
87 }; 87 };
88 88
89 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_MESSAGE_LISTENER_H_ 89 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TEST_MESSAGE_LISTENER_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_test_api.h ('k') | chrome/browser/extensions/extension_toolbar_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698