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

Unified Diff: chrome/browser/ui/search/instant_test_utils.h

Issue 2857023003: Instant/LocalNTP tests cleanup (Closed)
Patch Set: skip incompatible tests if --site-per-process Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/search/instant_test_utils.h
diff --git a/chrome/browser/ui/search/instant_test_utils.h b/chrome/browser/ui/search/instant_test_utils.h
index 0d5f678b62c8e0a873122a37dab7fc666fb6b08b..0141d15e70cda3ec9c343e71d9b1e00ba4b0be0f 100644
--- a/chrome/browser/ui/search/instant_test_utils.h
+++ b/chrome/browser/ui/search/instant_test_utils.h
@@ -8,85 +8,23 @@
#include <string>
#include "base/macros.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_instant_controller.h"
-#include "chrome/browser/ui/browser_window.h"
-#include "chrome/browser/ui/location_bar/location_bar.h"
-#include "chrome/browser/ui/search/instant_controller.h"
#include "content/public/test/browser_test_utils.h"
-#include "net/test/embedded_test_server/embedded_test_server.h"
-#include "url/gurl.h"
-class OmniboxView;
+namespace instant_test_utils {
-// This utility class is meant to be used in a "mix-in" fashion, giving the
-// derived test class additional Instant-related functionality.
-class InstantTestBase {
- protected:
- InstantTestBase();
- virtual ~InstantTestBase();
-
- protected:
- void SetupInstant(Browser* browser);
- void Init(const GURL& instant_url, const GURL& ntp_url,
- bool init_suggestions_url);
-
- void set_browser(Browser* browser) {
- browser_ = browser;
- }
-
- OmniboxView* omnibox() {
- return browser_->window()->GetLocationBar()->GetOmniboxView();
- }
-
- const GURL& instant_url() const { return instant_url_; }
-
- const GURL& ntp_url() const { return ntp_url_; }
-
- net::EmbeddedTestServer& https_test_server() { return https_test_server_; }
-
- void FocusOmnibox();
-
- void SetOmniboxText(const std::string& text);
-
- void PressEnterAndWaitForNavigation();
- void PressEnterAndWaitForFrameLoad();
-
- bool GetBoolFromJS(const content::ToRenderFrameHost& adapter,
+bool GetBoolFromJS(const content::ToRenderFrameHost& adapter,
+ const std::string& script,
+ bool* result) WARN_UNUSED_RESULT;
+bool GetIntFromJS(const content::ToRenderFrameHost& adapter,
+ const std::string& script,
+ int* result) WARN_UNUSED_RESULT;
+bool GetDoubleFromJS(const content::ToRenderFrameHost& adapter,
const std::string& script,
- bool* result) WARN_UNUSED_RESULT;
- bool GetIntFromJS(const content::ToRenderFrameHost& adapter,
- const std::string& script,
- int* result) WARN_UNUSED_RESULT;
- bool GetDoubleFromJS(const content::ToRenderFrameHost& adapter,
- const std::string& script,
- double* result) WARN_UNUSED_RESULT;
- bool GetStringFromJS(const content::ToRenderFrameHost& adapter,
- const std::string& script,
- std::string* result) WARN_UNUSED_RESULT;
-
- std::string GetOmniboxText();
-
- // Loads a named image from url |image| from the given |rvh| host. |loaded|
- // returns whether the image was able to load without error.
- // The method returns true if the JavaScript executed cleanly.
- bool LoadImage(content::RenderViewHost* rvh,
- const std::string& image,
- bool* loaded);
-
- private:
- GURL instant_url_;
- GURL ntp_url_;
-
- Browser* browser_;
-
- // HTTPS Testing server, started on demand.
- net::EmbeddedTestServer https_test_server_;
-
- // Set to true to initialize suggestions URL in default search provider.
- bool init_suggestions_url_;
+ double* result) WARN_UNUSED_RESULT;
+bool GetStringFromJS(const content::ToRenderFrameHost& adapter,
+ const std::string& script,
+ std::string* result) WARN_UNUSED_RESULT;
- DISALLOW_COPY_AND_ASSIGN(InstantTestBase);
-};
+} // namespace instant_test_utils
#endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_

Powered by Google App Engine
This is Rietveld 408576698