Home | History | Annotate | Download | only in nacl
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_TEST_NACL_PNACL_HEADER_TEST_H_
      6 #define CHROME_TEST_NACL_PNACL_HEADER_TEST_H_
      7 
      8 #include "base/compiler_specific.h"
      9 #include "base/memory/scoped_ptr.h"
     10 #include "chrome/test/base/in_process_browser_test.h"
     11 
     12 namespace base {
     13 class FilePath;
     14 }
     15 
     16 namespace net {
     17 namespace test_server {
     18 struct HttpRequest;
     19 class HttpResponse;
     20 }
     21 }
     22 
     23 class PnaclHeaderTest : public InProcessBrowserTest {
     24  public:
     25   PnaclHeaderTest();
     26   virtual ~PnaclHeaderTest();
     27 
     28   // Run a simple test that checks that the NaCl plugin sends the right
     29   // headers when doing |expected_noncors| same origin pexe load requests
     30   // and |expected_cors| cross origin pexe load requests.
     31   void RunLoadTest(const std::string& url,
     32                    int expected_noncors,
     33                    int expected_cors);
     34 
     35  private:
     36   void StartServer();
     37 
     38   scoped_ptr<net::test_server::HttpResponse> WatchForPexeFetch(
     39       const net::test_server::HttpRequest& request);
     40 
     41   int noncors_loads_;
     42   int cors_loads_;
     43   DISALLOW_COPY_AND_ASSIGN(PnaclHeaderTest);
     44 };
     45 
     46 #endif  // CHROME_TEST_NACL_PNACL_HEADER_TEST_H_
     47