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

Side by Side Diff: chrome/test/ppapi/ppapi_test.h

Issue 10736064: Switch to TimeDelta interfaces in chrome automation test infrastructure. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_TEST_PPAPI_PPAPI_TEST_H_ 5 #ifndef CHROME_TEST_PPAPI_PPAPI_TEST_H_
6 #define CHROME_TEST_PPAPI_PPAPI_TEST_H_ 6 #define CHROME_TEST_PPAPI_PPAPI_TEST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 26 matching lines...) Expand all
37 void RunTestWithSSLServer(const std::string& test_case); 37 void RunTestWithSSLServer(const std::string& test_case);
38 void RunTestWithWebSocketServer(const std::string& test_case); 38 void RunTestWithWebSocketServer(const std::string& test_case);
39 void RunTestIfAudioOutputAvailable(const std::string& test_case); 39 void RunTestIfAudioOutputAvailable(const std::string& test_case);
40 void RunTestViaHTTPIfAudioOutputAvailable(const std::string& test_case); 40 void RunTestViaHTTPIfAudioOutputAvailable(const std::string& test_case);
41 std::string StripPrefixes(const std::string& test_name); 41 std::string StripPrefixes(const std::string& test_name);
42 42
43 protected: 43 protected:
44 class TestFinishObserver : public content::NotificationObserver { 44 class TestFinishObserver : public content::NotificationObserver {
45 public: 45 public:
46 TestFinishObserver(content::RenderViewHost* render_view_host, 46 TestFinishObserver(content::RenderViewHost* render_view_host,
47 int timeout_s); 47 base::TimeDelta timeout);
48 48
49 bool WaitForFinish(); 49 bool WaitForFinish();
50 50
51 virtual void Observe(int type, 51 virtual void Observe(int type,
52 const content::NotificationSource& source, 52 const content::NotificationSource& source,
53 const content::NotificationDetails& details) OVERRIDE; 53 const content::NotificationDetails& details) OVERRIDE;
54 54
55 std::string result() const { return result_; } 55 std::string result() const { return result_; }
56 56
57 void Reset(); 57 void Reset();
58 58
59 private: 59 private:
60 void OnTimeout(); 60 void OnTimeout();
61 61
62 bool finished_; 62 bool finished_;
63 bool waiting_; 63 bool waiting_;
64 int timeout_s_; 64 base::TimeDelta timeout_;
65 std::string result_; 65 std::string result_;
66 content::NotificationRegistrar registrar_; 66 content::NotificationRegistrar registrar_;
67 base::RepeatingTimer<TestFinishObserver> timer_; 67 base::RepeatingTimer<TestFinishObserver> timer_;
68 68
69 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); 69 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver);
70 }; 70 };
71 71
72 // Runs the test for a tab given the tab that's already navigated to the 72 // Runs the test for a tab given the tab that's already navigated to the
73 // given URL. 73 // given URL.
74 void RunTestURL(const GURL& test_url); 74 void RunTestURL(const GURL& test_url);
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 class PPAPINaClTestDisallowedSockets : public PPAPITestBase { 127 class PPAPINaClTestDisallowedSockets : public PPAPITestBase {
128 public: 128 public:
129 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; 129 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE;
130 130
131 virtual std::string BuildQuery(const std::string& base, 131 virtual std::string BuildQuery(const std::string& base,
132 const std::string& test_case) OVERRIDE; 132 const std::string& test_case) OVERRIDE;
133 }; 133 };
134 134
135 #endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_ 135 #endif // CHROME_TEST_PPAPI_PPAPI_TEST_H_
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | chrome/test/ppapi/ppapi_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698