summaryrefslogtreecommitdiffstats
path: root/ppapi/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/tests')
-rw-r--r--ppapi/tests/extensions/background_keepalive/background.cc63
-rw-r--r--ppapi/tests/extensions/background_keepalive/background.js41
-rw-r--r--ppapi/tests/extensions/background_keepalive/manifest.json11
-rw-r--r--ppapi/tests/extensions/extensions.gyp19
4 files changed, 0 insertions, 134 deletions
diff --git a/ppapi/tests/extensions/background_keepalive/background.cc b/ppapi/tests/extensions/background_keepalive/background.cc
deleted file mode 100644
index 59dd5ef..0000000
--- a/ppapi/tests/extensions/background_keepalive/background.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <cstdio>
-#include <string>
-
-#include "ppapi/cpp/instance.h"
-#include "ppapi/cpp/message_loop.h"
-#include "ppapi/cpp/module.h"
-#include "ppapi/cpp/var.h"
-#include "ppapi/utility/completion_callback_factory.h"
-
-class Instance : public pp::Instance {
- public:
- explicit Instance(PP_Instance instance) :
- pp::Instance(instance),
- callback_factory_(this),
- delay_milliseconds_(10),
- active_(true) {
- DoSomething(PP_OK);
- }
- virtual ~Instance() {}
-
- virtual void HandleMessage(const pp::Var& message_var) {
- std::string message_string = message_var.AsString();
- if (message_string == "be idle") {
- active_ = false;
- } else {
- PostMessage("Unhandled control message.");
- }
- }
-
- void DoSomething(int32_t result) {
- if (active_) {
- pp::MessageLoop loop = pp::MessageLoop::GetCurrent();
- pp::CompletionCallback c = callback_factory_.NewCallback(
- &Instance::DoSomething);
- loop.PostWork(c, delay_milliseconds_);
- }
- }
-
- pp::CompletionCallbackFactory<Instance> callback_factory_;
- int delay_milliseconds_;
- bool active_;
-};
-
-class Module : public pp::Module {
- public:
- Module() : pp::Module() {}
- virtual ~Module() {}
-
- virtual pp::Instance* CreateInstance(PP_Instance instance) {
- return new Instance(instance);
- }
-};
-
-namespace pp {
-Module* CreateModule() {
- return new ::Module();
-}
-} // namespace pp
-
diff --git a/ppapi/tests/extensions/background_keepalive/background.js b/ppapi/tests/extensions/background_keepalive/background.js
deleted file mode 100644
index 6b9c259..0000000
--- a/ppapi/tests/extensions/background_keepalive/background.js
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var NaClModulesExpected = 0;
-var NaClModulesLoaded = 0;
-
-// Indicate load success.
-function moduleDidLoad() {
- NaClModulesLoaded++;
- if (NaClModulesLoaded == NaClModulesExpected)
- chrome.test.sendMessage("nacl_modules_loaded", handleChromeTestMessage);
-}
-
-var handleChromeTestMessage = function (message) {
- NaClModules = document.querySelectorAll('embed');
- for (var i = 0; i < NaClModules.length; i++) {
- NaClModules[i].postMessage(message);
- }
-}
-
-function handleNaclMessage(message_event) {
- console.log("handleNaclMessage: " + message_event.data);
-}
-
-function createNaClEmbed() {
- NaClModulesExpected++;
-
- var listener = document.createElement("div");
- listener.addEventListener("load", moduleDidLoad, true);
- listener.addEventListener("message", handleNaclMessage, true);
- listener.innerHTML = '<embed' +
- ' src="ppapi_tests_extensions_background_keepalive.nmf"' +
- ' type="application/x-nacl" />';
- document.body.appendChild(listener);
-}
-
-// Create 2 embeds to verify that we can handle more than one.
-createNaClEmbed();
-createNaClEmbed();
-
diff --git a/ppapi/tests/extensions/background_keepalive/manifest.json b/ppapi/tests/extensions/background_keepalive/manifest.json
deleted file mode 100644
index 28fb912..0000000
--- a/ppapi/tests/extensions/background_keepalive/manifest.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "manifest_version": 2,
- "name": "background_nacl",
- "version": "0",
- "description": "Tests keeping background page with NaCl alive when active.",
- "app": {
- "background": {
- "scripts": ["background.js"]
- }
- }
-}
diff --git a/ppapi/tests/extensions/extensions.gyp b/ppapi/tests/extensions/extensions.gyp
index 70af268..d063b83f4 100644
--- a/ppapi/tests/extensions/extensions.gyp
+++ b/ppapi/tests/extensions/extensions.gyp
@@ -29,24 +29,5 @@
],
},
},
- {
- 'target_name': 'ppapi_tests_extensions_background_keepalive',
- 'type': 'none',
- 'variables': {
- 'nexe_target': 'ppapi_tests_extensions_background_keepalive',
- # Only newlib build is used in tests, no need to build others.
- 'build_newlib': 1,
- 'build_glibc': 0,
- 'build_pnacl_newlib': 0,
- 'nexe_destination_dir': 'test_data/ppapi/tests/extensions/background_keepalive',
- 'sources': [
- 'background_keepalive/background.cc',
- ],
- 'test_files': [
- 'background_keepalive/background.js',
- 'background_keepalive/manifest.json',
- ],
- },
- },
],
}