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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_apitest.cc

Issue 643703007: Adding app_view tests to app_shell_browsertests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@multiple_apps
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "extensions/browser/guest_view/web_view/web_view_apitest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_apitest.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 DCHECK(app_window_list.size() == 1); 154 DCHECK(app_window_list.size() == 1);
155 return (*app_window_list.begin())->web_contents(); 155 return (*app_window_list.begin())->web_contents();
156 } 156 }
157 157
158 void WebViewAPITest::RunTest(const std::string& test_name, 158 void WebViewAPITest::RunTest(const std::string& test_name,
159 const std::string& app_location) { 159 const std::string& app_location) {
160 LaunchApp(app_location); 160 LaunchApp(app_location);
161 161
162 ExtensionTestMessageListener done_listener("TEST_PASSED", false); 162 ExtensionTestMessageListener done_listener("TEST_PASSED", false);
163 done_listener.set_failure_message("TEST_FAILED"); 163 done_listener.set_failure_message("TEST_FAILED");
164 if (!content::ExecuteScript( 164 ASSERT_TRUE(content::ExecuteScript(
165 embedder_web_contents_, 165 embedder_web_contents_,
166 base::StringPrintf("runTest('%s')", test_name.c_str()))) { 166 base::StringPrintf("runTest('%s')", test_name.c_str())))
167 LOG(ERROR) << "Unable to start test."; 167 << "Unable to start test.";
168 return;
169 }
170 ASSERT_TRUE(done_listener.WaitUntilSatisfied()); 168 ASSERT_TRUE(done_listener.WaitUntilSatisfied());
171 } 169 }
172 170
173 void WebViewAPITest::RunTestOnMainThreadLoop() { 171 void WebViewAPITest::RunTestOnMainThreadLoop() {
174 AppShellTest::RunTestOnMainThreadLoop(); 172 AppShellTest::RunTestOnMainThreadLoop();
175 GetGuestViewManager()->WaitForAllGuestsDeleted(); 173 GetGuestViewManager()->WaitForAllGuestsDeleted();
176 } 174 }
177 175
178 void WebViewAPITest::SetUpCommandLine(base::CommandLine* command_line) { 176 void WebViewAPITest::SetUpCommandLine(base::CommandLine* command_line) {
179 AppShellTest::SetUpCommandLine(command_line); 177 AppShellTest::SetUpCommandLine(command_line);
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 // object, on the webview element, and hanging directly off webview. 699 // object, on the webview element, and hanging directly off webview.
702 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) { 700 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIExistence) {
703 RunTest("testWebRequestAPIExistence", "web_view/apitest"); 701 RunTest("testWebRequestAPIExistence", "web_view/apitest");
704 } 702 }
705 703
706 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) { 704 IN_PROC_BROWSER_TEST_F(WebViewAPITest, TestWebRequestAPIGoogleProperty) {
707 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest"); 705 RunTest("testWebRequestAPIGoogleProperty", "web_view/apitest");
708 } 706 }
709 707
710 } // namespace extensions 708 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/app_view/app_view_apitest.cc ('k') | extensions/shell/app_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698