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

Side by Side Diff: chrome/test/nacl/pnacl_header_test.cc

Issue 286243003: Move JavascriptTestObserver from chrome to content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unnecessary content prefixes Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.cc ('k') | chrome/test/ppapi/ppapi_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/test/nacl/pnacl_header_test.h" 5 #include "chrome/test/nacl/pnacl_header_test.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 24 matching lines...) Expand all
35 embedded_test_server()->RegisterRequestHandler( 35 embedded_test_server()->RegisterRequestHandler(
36 base::Bind(&PnaclHeaderTest::WatchForPexeFetch, base::Unretained(this))); 36 base::Bind(&PnaclHeaderTest::WatchForPexeFetch, base::Unretained(this)));
37 embedded_test_server()->ServeFilesFromDirectory(test_data_dir); 37 embedded_test_server()->ServeFilesFromDirectory(test_data_dir);
38 } 38 }
39 39
40 void PnaclHeaderTest::RunLoadTest(const std::string& url, 40 void PnaclHeaderTest::RunLoadTest(const std::string& url,
41 int expected_noncors, 41 int expected_noncors,
42 int expected_cors) { 42 int expected_cors) {
43 StartServer(); 43 StartServer();
44 LoadTestMessageHandler handler; 44 LoadTestMessageHandler handler;
45 JavascriptTestObserver observer( 45 content::JavascriptTestObserver observer(
46 browser()->tab_strip_model()->GetActiveWebContents(), 46 browser()->tab_strip_model()->GetActiveWebContents(),
47 &handler); 47 &handler);
48 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL(url)); 48 ui_test_utils::NavigateToURL(browser(), embedded_test_server()->GetURL(url));
49 // Wait until the NMF and pexe are also loaded, not just the HTML. 49 // Wait until the NMF and pexe are also loaded, not just the HTML.
50 // Do this by waiting till the LoadTestMessageHandler responds. 50 // Do this by waiting till the LoadTestMessageHandler responds.
51 EXPECT_TRUE(observer.Run()) << handler.error_message(); 51 EXPECT_TRUE(observer.Run()) << handler.error_message();
52 EXPECT_TRUE(handler.test_passed()) << "Test failed."; 52 EXPECT_TRUE(handler.test_passed()) << "Test failed.";
53 EXPECT_EQ(expected_noncors, noncors_loads_); 53 EXPECT_EQ(expected_noncors, noncors_loads_);
54 EXPECT_EQ(expected_cors, cors_loads_); 54 EXPECT_EQ(expected_cors, cors_loads_);
55 } 55 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 http_response->set_code(net::HTTP_NOT_FOUND); 95 http_response->set_code(net::HTTP_NOT_FOUND);
96 http_response->set_content("PEXE ... not found"); 96 http_response->set_content("PEXE ... not found");
97 http_response->set_content_type("application/octet-stream"); 97 http_response->set_content_type("application/octet-stream");
98 return http_response.PassAs<HttpResponse>(); 98 return http_response.PassAs<HttpResponse>();
99 } 99 }
100 100
101 IN_PROC_BROWSER_TEST_F(PnaclHeaderTest, TestHasPnaclHeader) { 101 IN_PROC_BROWSER_TEST_F(PnaclHeaderTest, TestHasPnaclHeader) {
102 // Load 2 pexes, one same origin and one cross orgin. 102 // Load 2 pexes, one same origin and one cross orgin.
103 RunLoadTest("/nacl/pnacl_request_header/pnacl_request_header.html", 1, 1); 103 RunLoadTest("/nacl/pnacl_request_header/pnacl_request_header.html", 1, 1);
104 } 104 }
OLDNEW
« no previous file with comments | « chrome/test/nacl/nacl_browsertest_util.cc ('k') | chrome/test/ppapi/ppapi_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698