OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const char kTestEndpointUrl[] = "http://example.com/endpoint.html"; | 45 const char kTestEndpointUrl[] = "http://example.com/endpoint.html"; |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 class DriveFirstRunTest : public InProcessBrowserTest, | 49 class DriveFirstRunTest : public InProcessBrowserTest, |
50 public DriveFirstRunController::Observer { | 50 public DriveFirstRunController::Observer { |
51 protected: | 51 protected: |
52 DriveFirstRunTest(); | 52 DriveFirstRunTest(); |
53 | 53 |
54 // InProcessBrowserTest overrides: | 54 // InProcessBrowserTest overrides: |
55 virtual void SetUpOnMainThread() OVERRIDE; | 55 virtual void SetUpOnMainThread() override; |
56 virtual void TearDownOnMainThread() OVERRIDE; | 56 virtual void TearDownOnMainThread() override; |
57 | 57 |
58 // DriveFirstRunController::Observer overrides: | 58 // DriveFirstRunController::Observer overrides: |
59 virtual void OnCompletion(bool success) OVERRIDE; | 59 virtual void OnCompletion(bool success) override; |
60 virtual void OnTimedOut() OVERRIDE; | 60 virtual void OnTimedOut() override; |
61 | 61 |
62 void InstallApp(); | 62 void InstallApp(); |
63 | 63 |
64 void InitTestServer(const std::string& directory); | 64 void InitTestServer(const std::string& directory); |
65 | 65 |
66 bool WaitForFirstRunResult(); | 66 bool WaitForFirstRunResult(); |
67 | 67 |
68 void EnableOfflineMode(); | 68 void EnableOfflineMode(); |
69 | 69 |
70 void SetDelays(int initial_delay_secs, int timeout_secs); | 70 void SetDelays(int initial_delay_secs, int timeout_secs); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Test that the controller times out instead of hanging forever. | 182 // Test that the controller times out instead of hanging forever. |
183 InstallApp(); | 183 InstallApp(); |
184 InitTestServer(kBadServerDirectory); | 184 InitTestServer(kBadServerDirectory); |
185 SetDelays(0, 0); | 185 SetDelays(0, 0); |
186 EnableOfflineMode(); | 186 EnableOfflineMode(); |
187 EXPECT_FALSE(WaitForFirstRunResult()); | 187 EXPECT_FALSE(WaitForFirstRunResult()); |
188 EXPECT_TRUE(timed_out()); | 188 EXPECT_TRUE(timed_out()); |
189 } | 189 } |
190 | 190 |
191 } // namespace chromeos | 191 } // namespace chromeos |
OLD | NEW |