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

Unified Diff: chrome_frame/test/chrome_frame_test_utils.cc

Issue 2822016: [chrome_frame] Refactor/merge IE no interference tests with other mock event ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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
« no previous file with comments | « chrome_frame/test/chrome_frame_test_utils.h ('k') | chrome_frame/test/data/anchor.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/chrome_frame_test_utils.cc
===================================================================
--- chrome_frame/test/chrome_frame_test_utils.cc (revision 51968)
+++ chrome_frame/test/chrome_frame_test_utils.cc (working copy)
@@ -356,7 +356,8 @@
// This causes the IWebBrowser2 interface which is returned to be useless,
// i.e it does not receive any events, etc. Our workaround for this is
// to impersonate a low integrity token and then launch IE.
- if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA) {
+ if (win_util::GetWinVersion() == win_util::WINVERSION_VISTA &&
+ GetInstalledIEVersion() == IE_7) {
// Create medium integrity browser that will launch IE broker.
ScopedComPtr<IWebBrowser2> medium_integrity_browser;
hr = medium_integrity_browser.CreateInstance(CLSID_InternetExplorer, NULL,
@@ -893,6 +894,56 @@
return profile_path;
}
+FilePath GetTestDataFolder() {
+ FilePath test_dir;
+ PathService::Get(base::DIR_SOURCE_ROOT, &test_dir);
+ test_dir = test_dir.Append(FILE_PATH_LITERAL("chrome_frame"))
+ .Append(FILE_PATH_LITERAL("test"))
+ .Append(FILE_PATH_LITERAL("data"));
+ return test_dir;
+}
+
+std::wstring GetPathFromUrl(const std::wstring& url) {
+ string16 url16 = WideToUTF16(url);
+ GURL gurl = GURL(url16);
+ if (gurl.has_query()) {
+ GURL::Replacements replacements;
+ replacements.ClearQuery();
+ gurl = gurl.ReplaceComponents(replacements);
+ }
+ return UTF8ToWide(gurl.PathForRequest());
+}
+
+std::wstring GetPathAndQueryFromUrl(const std::wstring& url) {
+ string16 url16 = WideToUTF16(url);
+ GURL gurl = GURL(url16);
+ return UTF8ToWide(gurl.PathForRequest());
+}
+
+bool AddCFMetaTag(std::string* html_data) {
+ if (!html_data) {
+ NOTREACHED();
+ return false;
+ }
+ size_t head = html_data->find("<head>");
+ if (head == std::string::npos) {
+ // Add missing head section.
+ size_t html = html_data->find("<html>");
+ EXPECT_NE(std::string::npos, html) << "Meta tag will not be injected "
+ << "because the html tag could not be found";
+ if (html != std::string::npos) {
+ html_data->insert(html + strlen("<html>"), "<head></head>");
+ head = html_data->find("<head>");
+ }
+ }
+ if (head != std::string::npos) {
+ html_data->insert(
+ head + strlen("<head>"),
+ "<meta http-equiv=\"x-ua-compatible\" content=\"chrome=1\" />");
+ }
+ return head != std::string::npos;
+}
+
void DelaySendExtendedKeysEnter(TimedMsgLoop* loop, int delay, char c,
int repeat, simulate_input::Modifier mod) {
const unsigned int kInterval = 25;
« no previous file with comments | « chrome_frame/test/chrome_frame_test_utils.h ('k') | chrome_frame/test/data/anchor.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698