summaryrefslogtreecommitdiffstats
path: root/ppapi/tests
diff options
context:
space:
mode:
authordrewry@google.com <drewry@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-04 00:39:16 +0000
committerdrewry@google.com <drewry@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-04 00:39:16 +0000
commit595a5ed2dd2b5e1439f5a26cf005a911377185db (patch)
treec37f43a30cf7f2e9314d1d3ff45d002475fabcb4 /ppapi/tests
parent5694e080994969f42458cde89f8130c386240925 (diff)
downloadchromium_src-595a5ed2dd2b5e1439f5a26cf005a911377185db.zip
chromium_src-595a5ed2dd2b5e1439f5a26cf005a911377185db.tar.gz
chromium_src-595a5ed2dd2b5e1439f5a26cf005a911377185db.tar.bz2
Generate and connect a Pepper identifier for Chrome OS
This change wires up GetDeviceID and passes in the BrowserContext into PepperMessageFilter rather than the extracted ResourceContext. The pepper drm identifier is a value provided for use by flash. It may be reset or disabled by the user and cannot function in OffTheRecord embodiments. In Guest mode, the identifier is never generated. When in incognito, the ppapi plugin will be informed of the the profile state and not make the call. Later, this will be enforced in the message filter as well. Note, the preference is currently defaulted to true and does not have a UI connection. The UI is being wired up as part of crbug.com/125899. At which point, we can make the setting syncable and chose the preferred default. This change bounces the GetDeviceID call through the renderer back to the browser so that we have the path context to read the file from. This same approach can be used to allow OTR checking and preference reading if that is preferable to a file. If we need to do anything on the UI thread, we should do everything there (OTR+Pref). Since the ID is regenerated at every pref init/toggle, we can move the value around without impacting users in the future. Please let me know if I've totally botched the wiring for this. I'm not sure the best way to fully test it. TEST=built and tested on x86-alex target: - ID is generated for normal sign-in in /home/chronos/user and is not generated for Guest. - Very lightweight ppapi test was run too. (Still need pointers on better flash api wiring testing to make sure it is seeing right string) - Pepper flash still worked normally Also built full x86-alex system image: - booted it - checked the file existence in both modes - checked pepflash and talk video for normal functionality TRYBOT=http://build.chromium.org/p/tryserver.chromium/builders/cros_x86/builds/353 BUG=chromium-os:30378 Change-Id: Ibfbc484918d94147ad4fdc522a6415c71731068b R=brettw,sky,piman,viettrungluu Review URL: http://codereview.chromium.org/10342013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135255 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests')
-rw-r--r--ppapi/tests/test_flash.cc10
-rw-r--r--ppapi/tests/test_flash.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/ppapi/tests/test_flash.cc b/ppapi/tests/test_flash.cc
index 2657bf0..51ee08c 100644
--- a/ppapi/tests/test_flash.cc
+++ b/ppapi/tests/test_flash.cc
@@ -32,6 +32,7 @@ void TestFlash::RunTests(const std::string& filter) {
RUN_TEST(MessageLoop, filter);
RUN_TEST(GetLocalTimeZoneOffset, filter);
RUN_TEST(GetCommandLineArgs, filter);
+ RUN_TEST(GetDeviceID, filter);
}
std::string TestFlash::TestSetInstanceAlwaysOnTop() {
@@ -99,6 +100,15 @@ std::string TestFlash::TestGetCommandLineArgs() {
PASS();
}
+std::string TestFlash::TestGetDeviceID() {
+ Var result(pp::PASS_REF,
+ flash_interface_->GetDeviceID(instance_->pp_instance()));
+ // TODO(wad) figure out how to mock the input and test the full flow.
+ ASSERT_TRUE(result.is_string());
+ PASS();
+}
+
+
void TestFlash::QuitMessageLoopTask(int32_t) {
flash_interface_->QuitMessageLoop(instance_->pp_instance());
}
diff --git a/ppapi/tests/test_flash.h b/ppapi/tests/test_flash.h
index fba35ee..bd16930 100644
--- a/ppapi/tests/test_flash.h
+++ b/ppapi/tests/test_flash.h
@@ -29,6 +29,7 @@ class TestFlash : public TestCase {
std::string TestMessageLoop();
std::string TestGetLocalTimeZoneOffset();
std::string TestGetCommandLineArgs();
+ std::string TestGetDeviceID();
void QuitMessageLoopTask(int32_t);