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

Unified Diff: ppapi/tests/testing_instance.cc

Issue 1088763002: Plugin Power Saver: Add comprehensive browser tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0260-plugins-overhaul-prerender-tests
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/tests/testing_instance.cc
diff --git a/ppapi/tests/testing_instance.cc b/ppapi/tests/testing_instance.cc
index b1eaae460e3b83007848706f5424b692704c2ffa..7f05fb278c1d76f70305bc3464bd95e50882b02d 100644
--- a/ppapi/tests/testing_instance.cc
+++ b/ppapi/tests/testing_instance.cc
@@ -13,8 +13,10 @@
#include "ppapi/cpp/core.h"
#include "ppapi/cpp/module.h"
#include "ppapi/cpp/var.h"
+#include "ppapi/cpp/var_dictionary.h"
#include "ppapi/cpp/view.h"
#include "ppapi/tests/test_case.h"
+#include "ppapi/tests/test_utils.h"
TestCaseFactory* TestCaseFactory::head_ = NULL;
@@ -93,6 +95,14 @@ pp::Var TestingInstance::GetInstanceObject() {
void TestingInstance::HandleMessage(const pp::Var& message_data) {
if (current_case_)
current_case_->HandleMessage(message_data);
+
+ if (message_data.is_string() && (message_data.AsString() == "isPeripheral")) {
+ pp::VarDictionary message;
+ message.Set(
+ "isPeripheral",
+ pp::Var(PP_ToBool(GetTestingInterface()->IsPeripheral(pp_instance()))));
+ PostMessage(message);
+ }
raymes 2015/04/17 01:13:44 It's a bit weird to have this here because this is
tommycli 2015/04/17 23:45:33 Done.
}
void TestingInstance::DidChangeView(const pp::View& view) {
« content/renderer/pepper/plugin_power_saver_helper.cc ('K') | « ppapi/shared_impl/ppapi_constants.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698