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 // Initialize (but not Start()) the test HTTPS server. | |
| 44 https_test_server_ = new net::TestServer( | |
|
sreeram
2013/02/01 22:03:24
You could make this an initializer:
InstantTestBas
Mathieu
2013/02/04 20:37:36
Done.
| |
| 45 net::TestServer::TYPE_HTTPS, | |
| 46 net::BaseTestServer::SSLOptions(), | |
| 47 FilePath(FILE_PATH_LITERAL("chrome/test/data"))); | |
| 48 } | |
| 49 | |
| 41 protected: | 50 protected: |
| 42 void SetupInstant(); | 51 void SetupInstant(); |
| 43 void SetupInstantUsingTemplateURL(); | 52 void SetupInstantUsingTemplateURL(); |
| 44 | 53 |
| 45 InstantController* instant() { | 54 InstantController* instant() { |
| 46 return browser()->instant_controller()->instant(); | 55 return browser()->instant_controller()->instant(); |
| 47 } | 56 } |
| 48 | 57 |
| 49 OmniboxView* omnibox() { | 58 OmniboxView* omnibox() { |
| 50 return browser()->window()->GetLocationBar()->GetLocationEntry(); | 59 return browser()->window()->GetLocationBar()->GetLocationEntry(); |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 65 const std::string& script, | 74 const std::string& script, |
| 66 int* result) WARN_UNUSED_RESULT; | 75 int* result) WARN_UNUSED_RESULT; |
| 67 bool GetStringFromJS(content::WebContents* contents, | 76 bool GetStringFromJS(content::WebContents* contents, |
| 68 const std::string& script, | 77 const std::string& script, |
| 69 std::string* result) WARN_UNUSED_RESULT; | 78 std::string* result) WARN_UNUSED_RESULT; |
| 70 bool ExecuteScript(const std::string& script) WARN_UNUSED_RESULT; | 79 bool ExecuteScript(const std::string& script) WARN_UNUSED_RESULT; |
| 71 bool CheckVisibilityIs(content::WebContents* contents, | 80 bool CheckVisibilityIs(content::WebContents* contents, |
| 72 bool expected) WARN_UNUSED_RESULT; | 81 bool expected) WARN_UNUSED_RESULT; |
| 73 | 82 |
| 74 GURL instant_url_; | 83 GURL instant_url_; |
| 84 | |
| 85 // HTTPS Testing server, started on demand. | |
| 86 net::TestServer* https_test_server_; | |
| 75 }; | 87 }; |
| 76 | 88 |
| 77 #endif // CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ | 89 #endif // CHROME_BROWSER_INSTANT_INSTANT_TEST_UTILS_H_ |
| OLD | NEW |