| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "chrome/browser/download/download_prefs.h" | 8 #include "chrome/browser/download/download_prefs.h" |
| 9 #include "chrome/browser/extensions/event_router.h" | 9 #include "chrome/browser/extensions/event_router.h" |
| 10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // extension to have MIME type 'application/msword' and the resources that | 90 // extension to have MIME type 'application/msword' and the resources that |
| 91 // should be downloaded by the browser to have MIME type 'plain/text'. | 91 // should be downloaded by the browser to have MIME type 'plain/text'. |
| 92 class StreamsPrivateApiTest : public ExtensionApiTest { | 92 class StreamsPrivateApiTest : public ExtensionApiTest { |
| 93 public: | 93 public: |
| 94 StreamsPrivateApiTest() {} | 94 StreamsPrivateApiTest() {} |
| 95 | 95 |
| 96 virtual ~StreamsPrivateApiTest() {} | 96 virtual ~StreamsPrivateApiTest() {} |
| 97 | 97 |
| 98 virtual void SetUpOnMainThread() OVERRIDE { | 98 virtual void SetUpOnMainThread() OVERRIDE { |
| 99 // Init test server. | 99 // Init test server. |
| 100 test_server_.reset(new EmbeddedTestServer( | 100 test_server_.reset(new EmbeddedTestServer); |
| 101 content::BrowserThread::GetMessageLoopProxyForThread( | |
| 102 content::BrowserThread::IO))); | |
| 103 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); | 101 ASSERT_TRUE(test_server_->InitializeAndWaitUntilReady()); |
| 104 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); | 102 test_server_->RegisterRequestHandler(base::Bind(&HandleRequest)); |
| 105 | 103 |
| 106 ExtensionApiTest::SetUpOnMainThread(); | 104 ExtensionApiTest::SetUpOnMainThread(); |
| 107 } | 105 } |
| 108 | 106 |
| 109 virtual void CleanUpOnMainThread() OVERRIDE { | 107 virtual void CleanUpOnMainThread() OVERRIDE { |
| 110 // Tear down the test server. | 108 // Tear down the test server. |
| 111 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); | 109 EXPECT_TRUE(test_server_->ShutdownAndWaitUntilComplete()); |
| 112 test_server_.reset(); | 110 test_server_.reset(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 // The test extension should not receive any events by now. Send it an event | 313 // The test extension should not receive any events by now. Send it an event |
| 316 // with MIME type "test/done", so it stops waiting for the events. (If there | 314 // with MIME type "test/done", so it stops waiting for the events. (If there |
| 317 // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will | 315 // was an event with MIME type 'plain/text', |catcher.GetNextResult()| will |
| 318 // fail regardless of the sent event; chrome.test.notifySuccess will not be | 316 // fail regardless of the sent event; chrome.test.notifySuccess will not be |
| 319 // called by the extension). | 317 // called by the extension). |
| 320 SendDoneEvent(); | 318 SendDoneEvent(); |
| 321 EXPECT_TRUE(catcher.GetNextResult()); | 319 EXPECT_TRUE(catcher.GetNextResult()); |
| 322 } | 320 } |
| 323 | 321 |
| 324 } // namespace | 322 } // namespace |
| OLD | NEW |