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

Unified Diff: chrome/browser/ui/search/instant_test_base.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_base.h
diff --git a/chrome/browser/ui/search/instant_test_utils.h b/chrome/browser/ui/search/instant_test_base.h
similarity index 37%
copy from chrome/browser/ui/search/instant_test_utils.h
copy to chrome/browser/ui/search/instant_test_base.h
index 0d5f678b62c8e0a873122a37dab7fc666fb6b08b..07437a57aecfc2028839df093575cf418398ac25 100644
--- a/chrome/browser/ui/search/instant_test_utils.h
+++ b/chrome/browser/ui/search/instant_test_base.h
@@ -2,22 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_
-#define CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_
+#ifndef CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_BASE_H_
+#define CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_BASE_H_
#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;
+class Browser;
// This utility class is meant to be used in a "mix-in" fashion, giving the
// derived test class additional Instant-related functionality.
@@ -27,53 +21,20 @@ class InstantTestBase {
virtual ~InstantTestBase();
protected:
+ void set_browser(Browser* browser) { browser_ = browser; }
+ Browser* instant_browser() { return browser_; }
+
void SetupInstant(Browser* browser);
- void Init(const GURL& instant_url, const GURL& ntp_url,
+ 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,
- 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_;
@@ -89,4 +50,4 @@ class InstantTestBase {
DISALLOW_COPY_AND_ASSIGN(InstantTestBase);
};
-#endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_UTILS_H_
+#endif // CHROME_BROWSER_UI_SEARCH_INSTANT_TEST_BASE_H_

Powered by Google App Engine
This is Rietveld 408576698