Index: chrome/browser/browsing_data_helper_browsertest.h |
diff --git a/chrome/browser/browsing_data_helper_browsertest.h b/chrome/browser/browsing_data_helper_browsertest.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..8acf9f9fb797eb951a3cbc397b3fb58300d7848b |
--- /dev/null |
+++ b/chrome/browser/browsing_data_helper_browsertest.h |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+// Contains code shared by all browsing data browsertests. |
+ |
+#ifndef CHROME_BROWSER_BROWSING_DATA_HELPER_BROWSERTEST_H_ |
+#define CHROME_BROWSER_BROWSING_DATA_HELPER_BROWSERTEST_H_ |
+#pragma once |
+ |
+#include <vector> |
+ |
+#include "base/basictypes.h" |
+#include "base/message_loop.h" |
+ |
+// This template can be used for the StartFetching methods of the browsing data |
+// helper classes. It is supposed to be instantiated with the respective browsing |
+// data info type. |
+template <typename T> |
+class BrowsingDataHelperCallback { |
+ public: |
+ BrowsingDataHelperCallback() {} |
+ |
+ const std::vector<T>& result() |
+ { |
+ MessageLoop::current()->Run(); |
Bernhard Bauer
2011/02/10 12:52:19
Maybe you could DCHECK that |result_| was actually
|
+ return result_; |
+ } |
+ |
+ void callback(const std::vector<T>& info) { |
+ result_ = info; |
+ MessageLoop::current()->Quit(); |
+ } |
+ |
+ private: |
+ std::vector<T> result_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BrowsingDataHelperCallback); |
+}; |
+ |
+#endif // CHROME_BROWSER_BROWSING_DATA_HELPER_BROWSERTEST_H_ |