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 "chrome/test/ppapi/ppapi_test.h" | 5 #include "chrome/test/ppapi/ppapi_test.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
27 #include "content/public/browser/web_contents.h" | 27 #include "content/public/browser/web_contents.h" |
28 #include "media/base/media_switches.h" | 28 #include "media/base/media_switches.h" |
29 #include "net/base/filename_util.h" | 29 #include "net/base/filename_util.h" |
30 #include "net/base/test_data_directory.h" | 30 #include "net/base/test_data_directory.h" |
31 #include "ppapi/shared_impl/ppapi_switches.h" | 31 #include "ppapi/shared_impl/ppapi_switches.h" |
32 #include "ui/gl/gl_switches.h" | 32 #include "ui/gl/gl_switches.h" |
33 | 33 |
34 using content::DomOperationNotificationDetails; | 34 using content::DomOperationNotificationDetails; |
35 using content::RenderViewHost; | 35 using content::RenderViewHost; |
| 36 using content::TestMessageHandler; |
36 | 37 |
37 namespace { | 38 namespace { |
38 | 39 |
39 // Platform-specific filename relative to the chrome executable. | 40 // Platform-specific filename relative to the chrome executable. |
40 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
41 const wchar_t library_name[] = L"ppapi_tests.dll"; | 42 const wchar_t library_name[] = L"ppapi_tests.dll"; |
42 #elif defined(OS_MACOSX) | 43 #elif defined(OS_MACOSX) |
43 const char library_name[] = "ppapi_tests.plugin"; | 44 const char library_name[] = "ppapi_tests.plugin"; |
44 #elif defined(OS_POSIX) | 45 #elif defined(OS_POSIX) |
45 const char library_name[] = "libppapi_tests.so"; | 46 const char library_name[] = "libppapi_tests.so"; |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return; | 274 return; |
274 } | 275 } |
275 #endif | 276 #endif |
276 | 277 |
277 // See comment above TestingInstance in ppapi/test/testing_instance.h. | 278 // See comment above TestingInstance in ppapi/test/testing_instance.h. |
278 // Basically it sends messages using the DOM automation controller. The | 279 // Basically it sends messages using the DOM automation controller. The |
279 // value of "..." means it's still working and we should continue to wait, | 280 // value of "..." means it's still working and we should continue to wait, |
280 // any other value indicates completion (in this case it will start with | 281 // any other value indicates completion (in this case it will start with |
281 // "PASS" or "FAIL"). This keeps us from timing out on waits for long tests. | 282 // "PASS" or "FAIL"). This keeps us from timing out on waits for long tests. |
282 PPAPITestMessageHandler handler; | 283 PPAPITestMessageHandler handler; |
283 JavascriptTestObserver observer( | 284 content::JavascriptTestObserver observer( |
284 browser()->tab_strip_model()->GetActiveWebContents(), | 285 browser()->tab_strip_model()->GetActiveWebContents(), |
285 &handler); | 286 &handler); |
286 | 287 |
287 ui_test_utils::NavigateToURL(browser(), test_url); | 288 ui_test_utils::NavigateToURL(browser(), test_url); |
288 | 289 |
289 ASSERT_TRUE(observer.Run()) << handler.error_message(); | 290 ASSERT_TRUE(observer.Run()) << handler.error_message(); |
290 EXPECT_STREQ("PASS", handler.message().c_str()); | 291 EXPECT_STREQ("PASS", handler.message().c_str()); |
291 } | 292 } |
292 | 293 |
293 GURL PPAPITestBase::GetTestURL( | 294 GURL PPAPITestBase::GetTestURL( |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 } | 489 } |
489 | 490 |
490 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 491 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
491 // The default content setting for the PPAPI broker is ASK. We purposefully | 492 // The default content setting for the PPAPI broker is ASK. We purposefully |
492 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 493 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
493 | 494 |
494 base::FilePath plugin_lib; | 495 base::FilePath plugin_lib; |
495 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 496 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
496 EXPECT_TRUE(base::PathExists(plugin_lib)); | 497 EXPECT_TRUE(base::PathExists(plugin_lib)); |
497 } | 498 } |
OLD | NEW |