Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ |
| 6 #define CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 InstantModel* const model_; | 33 InstantModel* const model_; |
| 34 const chrome::search::Mode::Type desired_mode_type_; | 34 const chrome::search::Mode::Type desired_mode_type_; |
| 35 base::RunLoop run_loop_; | 35 base::RunLoop run_loop_; |
| 36 | 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(InstantTestModelObserver); | 37 DISALLOW_COPY_AND_ASSIGN(InstantTestModelObserver); |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 class InstantTestBase : public InProcessBrowserTest { | 40 class InstantTestBase : public InProcessBrowserTest { |
| 41 public: | |
| 42 InstantTestBase() | |
| 43 : https_test_server_(new net::TestServer( | |
| 44 net::TestServer::TYPE_HTTPS, | |
| 45 net::BaseTestServer::SSLOptions(), | |
| 46 FilePath(FILE_PATH_LITERAL("chrome/test/data")))) { | |
| 47 } | |
| 48 | |
| 41 protected: | 49 protected: |
| 42 void SetupInstant(); | 50 void SetupInstant(); |
| 43 void SetupInstantUsingTemplateURL(); | 51 void SetupInstantUsingTemplateURL(); |
| 44 | 52 |
| 45 InstantController* instant() { | 53 InstantController* instant() { |
| 46 return browser()->instant_controller()->instant(); | 54 return browser()->instant_controller()->instant(); |
| 47 } | 55 } |
| 48 | 56 |
| 49 OmniboxView* omnibox() { | 57 OmniboxView* omnibox() { |
| 50 return browser()->window()->GetLocationBar()->GetLocationEntry(); | 58 return browser()->window()->GetLocationBar()->GetLocationEntry(); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 65 const std::string& script, | 73 const std::string& script, |
| 66 int* result) WARN_UNUSED_RESULT; | 74 int* result) WARN_UNUSED_RESULT; |
| 67 bool GetStringFromJS(content::WebContents* contents, | 75 bool GetStringFromJS(content::WebContents* contents, |
| 68 const std::string& script, | 76 const std::string& script, |
| 69 std::string* result) WARN_UNUSED_RESULT; | 77 std::string* result) WARN_UNUSED_RESULT; |
| 70 bool ExecuteScript(const std::string& script) WARN_UNUSED_RESULT; | 78 bool ExecuteScript(const std::string& script) WARN_UNUSED_RESULT; |
| 71 bool CheckVisibilityIs(content::WebContents* contents, | 79 bool CheckVisibilityIs(content::WebContents* contents, |
| 72 bool expected) WARN_UNUSED_RESULT; | 80 bool expected) WARN_UNUSED_RESULT; |
| 73 | 81 |
| 74 GURL instant_url_; | 82 GURL instant_url_; |
| 83 | |
| 84 // HTTPS Testing server, started on demand. | |
| 85 net::TestServer* const https_test_server_; | |
|
sreeram
2013/02/05 20:19:10
This should be scoped_ptr so that it gets freed co
sreeram
2013/02/05 20:38:24
In fact, why bother with scoped_ptr. Just make it
Mathieu
2013/02/05 20:43:00
Done. Thanks!
| |
| 75 }; | 86 }; |
| 76 | 87 |
| 77 #endif // CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ | 88 #endif // CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ |
| OLD | NEW |