Last Comment Bug 742226 - Implement a generic uevent poller
: Implement a generic uevent poller
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Hardware Abstraction Layer (HAL) (show other bugs)
: unspecified
: All Gonk (Firefox OS)
: -- normal (vote)
: mozilla14
Assigned To: Cervantes Yu [:cyu] [:cervantes]
:
Mentors:
Depends on: 764773
Blocks: 736939 737153
  Show dependency treegraph
 
Reported: 2012-04-04 00:09 PDT by Cervantes Yu [:cyu] [:cervantes]
Modified: 2012-06-14 07:35 PDT (History)
5 users (show)
ryanvm: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Uevent poller implementation (7.12 KB, patch)
2012-04-05 01:00 PDT, Cervantes Yu [:cyu] [:cervantes]
no flags Details | Diff | Review
Refactor battery updater using the uevent poller (3.53 KB, patch)
2012-04-05 01:01 PDT, Cervantes Yu [:cyu] [:cervantes]
cjones.bugs: review-
Details | Diff | Review
Uevent poller implementation (v2) (7.07 KB, patch)
2012-04-09 02:57 PDT, Cervantes Yu [:cyu] [:cervantes]
no flags Details | Diff | Review
Refactor battery updater using the uevent poller (v2) (4.50 KB, patch)
2012-04-09 02:58 PDT, Cervantes Yu [:cyu] [:cervantes]
no flags Details | Diff | Review
Uevent poller implementation (v3) (7.01 KB, patch)
2012-04-10 01:40 PDT, Cervantes Yu [:cyu] [:cervantes]
cjones.bugs: review+
Details | Diff | Review
Refactor battery updater using the uevent poller (v3) (4.65 KB, patch)
2012-04-10 01:41 PDT, Cervantes Yu [:cyu] [:cervantes]
cjones.bugs: review+
Details | Diff | Review
Refactor battery updater using the uevent poller (v4) (4.75 KB, patch)
2012-04-11 01:01 PDT, Cervantes Yu [:cyu] [:cervantes]
cjones.bugs: review+
Details | Diff | Review
Uevent poller implementation (v4) (7.03 KB, patch)
2012-04-12 23:17 PDT, Cervantes Yu [:cyu] [:cervantes]
cyu: review+
Details | Diff | Review

Description Cervantes Yu [:cyu] [:cervantes] 2012-04-04 00:09:49 PDT
This bug is forked from bug 736939 to track the requirement for a generic uevent poller for at least the following requirements:

- battery update
- audio switch
- usb device hotplug
- usb cable connection/disconnection

There is an initial implementation in patch part 1 in the 736939, but there are some refinements:

- refactor current battery updater code to use this uevent backend
- the current implementation uses android's uevent decoder (class NetlinkEvent), we might need to come back to reimplement it considering support for Linux platform.
Comment 1 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-04 16:05:34 PDT
Also, this needs to build in ICS and GB. it might be easiest to just import the android code.

Phone
Comment 2 Cervantes Yu [:cyu] [:cervantes] 2012-04-05 01:00:29 PDT
Created attachment 612471 [details] [diff] [review]
Uevent poller implementation

The poller that polls uevent from netlink socket and notifies registered observers.
Comment 3 Cervantes Yu [:cyu] [:cervantes] 2012-04-05 01:01:54 PDT
Created attachment 612472 [details] [diff] [review]
Refactor battery updater using the uevent poller
Comment 4 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-06 22:57:09 PDT
Comment on attachment 612471 [details] [diff] [review]
Uevent poller implementation

High-level issue: it's very hard to manage object lifetimes across
multiple threads, which this patch and the next attempt to do.
Indeed, there's a use-after-free bug/race-condition in the second
patch that could result in a security vulnerability.

To make the model simplest for IUeventObserver, it'd be nice to have
the Broadcast() happen on the main thread.  But I understand why you
don't want to do that here: we want to discard unrecognized uevents as
quickly as possible, to avoid dispatching a lot of garbage to the main
thread from the IO thread.

So we need to have all this code run on the IO thread.  What this
means for this patch is, we have to restrict all the UeventPoller and
IUeventObserver code to run only on the IO thread.  They need to
assert when an attempt is made to use them off the IO thread.  I'll
explain this more in comments below.

The end result of this will be that the API will be a bit harder to
use for clients, but it will be safer memory-management- (and
security-) wise.

>diff --git a/hal/gonk/UeventPoller.cpp b/hal/gonk/UeventPoller.cpp

>+class NetlinkPoller : public RefCounted<NetlinkPoller>,
>+                      public MessageLoopForIO::Watcher

>+//  Mutex mMutex;
>+//

This code doesn't need a mutex, please remove this.

>+void
>+NetlinkPoller::OnFileCanReadWithoutBlocking(int fd)
>+{

>+    if (ret <= 0) {
>+      mReadWatcher.StopWatchingFileDescriptor();
>+      close(mSocket.mFd);
>+      mIOLoop->PostTask(FROM_HERE, new UeventInitTask());
>+      return;
>+    }

We should never get an unrecognized error here.  If we do, there's
probably something badly wrong in the kernel.  We might as well bail
out here or _exit(1).  I don't think that re-initializing the socket
is likely to help.  Do you know of a reason that we might get into
this error case?

>+void
>+sRegisterUeventListener(IUeventObserver *aObserver)
>+void
>+RegisterUeventListener(IUeventObserver *aObserver)

Remove the "sRegister" helper, and assert in RegisterUeventListener()
that it's running on the IO thread.

>+void static
>+sUnregisterUeventListener(IUeventObserver *aObserver)
>+void
>+UnregisterUeventListener(IUeventObserver *aObserver)

(Same here.)

>diff --git a/hal/gonk/UeventPoller.h b/hal/gonk/UeventPoller.h

>+namespace mozilla {
>+namespace hal_impl {
>+
>+typedef mozilla::Observer<NetlinkEvent> IUeventObserver;
>+
>+void RegisterUeventListener(IUeventObserver *aObserver);
>+
>+void UnregisterUeventListener(IUeventObserver *aObserver);
>+

Document here that this code is callable only from the IO thread, and
that Broadcast()s to observers only happen on the IO thread.

The rest of the patch looks mostly OK.  Please re-post another version
with the threading model fixed up :).
Comment 5 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-06 22:58:13 PDT
Comment on attachment 612472 [details] [diff] [review]
Refactor battery updater using the uevent poller

The DisableBatteryNotifications() code can racily delete the battery observer while the IO thread still holds a reference to it.  That can result in a security vulnerability.
Comment 6 Cervantes Yu [:cyu] [:cervantes] 2012-04-07 09:04:20 PDT
(In reply to Chris Jones [:cjones] [:warhammer] from comment #5)
> The DisableBatteryNotifications() code can racily delete the battery
> observer while the IO thread still holds a reference to it.  That can result
> in a security vulnerability.

There is another solution to consider: refcount the observer and then AddRef() when the observer is registered and Release() when unregistered, but the problem here is the registered observer should have refcount capability. This can be done in 2 levels:

1. Create abstract class RefcountedObserver which inherits from Observer and RefCounted. Then RegisterUevnetListener() and UnregisterUeventListener() accepts refcounted observer.

2. Make all existing Observers refcounted. Then the ObserverList will increment/decrement the refcount so it will never hold a deleted observer. Since observer code generally runs in another thread and the observer is the primary object shared between observing and notifying threads, this can prevent from similar errors in the future.

Chris, what do you think?
Comment 7 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-08 19:50:12 PDT
Threadsafe refcounted objects aren't really easier to manage than non-refcounted, in cases like this.

I strongly recommend we keep this code IO-thread-only.
Comment 8 Cervantes Yu [:cyu] [:cervantes] 2012-04-08 19:59:43 PDT
Or another simpler fix: just allocate the object statically. This saves us from newing/deleting it. The observer has a simple ctor and should not add noticeable cost to process startup.
Comment 9 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-08 20:18:14 PDT
Observers can be added and removed at any time.  The battery observer is added/removed because it holds XPCOM objects that get counted as leaks on shutdown.

TBH, I think the change I'm suggesting makes part 1 simpler, and doesn't change part 2 very much :).  Not sure about the headphone code yet.  So the changes shouldn't require much more work, I don't think.
Comment 10 Cervantes Yu [:cyu] [:cervantes] 2012-04-09 02:57:13 PDT
Created attachment 613256 [details] [diff] [review]
Uevent poller implementation (v2)

Uevent poller implementation v2. Updated per comment #4
Comment 11 Cervantes Yu [:cyu] [:cervantes] 2012-04-09 02:58:14 PDT
Created attachment 613258 [details] [diff] [review]
Refactor battery updater using the uevent poller (v2)

Updated per comment #4
Comment 12 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-09 21:19:53 PDT
Comment on attachment 613256 [details] [diff] [review]
Uevent poller implementation (v2)

>diff --git a/hal/gonk/UeventPoller.cpp b/hal/gonk/UeventPoller.cpp

>+namespace mozilla {
>+namespace hal_impl {
>+
>+void ShutdownUevent();
>+

|static void| please, and on definition below.

>+class NetlinkPoller : public RefCounted<NetlinkPoller>,

This class doesn't need to be refcounted; see below.

>+  virtual ~NetlinkPoller()
>+  {
>+    mReadWatcher.StopWatchingFileDescriptor();

This is unnecessary, mReadWatcher does this automatically.

>+  // no writing to the netlink socket
>+  virtual void OnFileCanWriteWithoutBlocking(int fd) { MOZ_ASSERT(false); }

Use MOZ_NOT_REACHED() here.

>+  typedef ObserverList<NetlinkEvent> UeventObserverList;
>+  UeventObserverList mUeventObserverList;
>+

Nit: there's an extraneous newline here, please remove it.

>+static RefPtr<NetlinkPoller> sPoller;
>+

This can be just an nsAutoPtr: there's only ever 0 or 1 references to
the sPoller object.

>+void
>+RegisterUeventListener(IUeventObserver *aObserver)
>+{
>+  MOZ_ASSERT(MessageLoop::current() == XRE_GetIOMessageLoop());
>+
>+  if (!sPoller)
>+    InitializeUevent();
>+  MOZ_ASSERT(sPoller);

No need to assert the poller here either: |::operator new| is
infallible in Gecko, meaning that |new Foo()| never returns NULL or
throws an exception.  And similarly, if sPoller is NULL, we'll safely
crash.

>+void
>+UnregisterUeventListener(IUeventObserver *aObserver)

>+  MOZ_ASSERT(sPoller);

No need to assert the poller here: if it's null, we'll crash, which is
just as good :).

>+  sPoller->UnregisterObserver(aObserver);
>+}
>+
>+} // hal_impl
>+} // mozilla
>+

>diff --git a/hal/gonk/UeventPoller.h b/hal/gonk/UeventPoller.h

>+#include "mozilla/Observer.h"
>+
>+// from android
>+#include "sysutils/NetlinkEvent.h"

Nit: Please remove this comment, list this header before
"mozilla/Observer.h", and include it as <sysutils/NetlinkEvent.h>.

>+

Nit: Extra newline here: just one please.

>+/**
>+ * Register for uevent notification. Note that the method should run on the
>+ * <b> IO Thread </b>
>+ * @aObserver the observer to be added

Please also add that the observer's Notify() method is only called on
the IO thread.

This patch looks good! :D I'd like to see one more version with the
comments above addressed.
Comment 13 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-09 21:42:03 PDT
Comment on attachment 613258 [details] [diff] [review]
Refactor battery updater using the uevent poller (v2)

>diff --git a/hal/gonk/GonkHal.cpp b/hal/gonk/GonkHal.cpp

>+static BatteryObserver *sBatteryObserver = NULL;

Note here that the IO thread "owns" this object: only the IO thread
may create/destroy it.

>+static void
>+sEnableBatteryNotifications()

Please call this |RegisterBatteryObserverIOThread()|

>+{

Assert here that this code is running on the IO thread.

>+  if (!sBatteryObserver)

Because the messages from main-thread to IO-thread are serialized in
the order they're generated on the main thread, the state will
"mirror" the main-thread state, except that it might be delayed a bit.

What that means here is that |RegisterBatteryObserverIOThread()|
should *never* be called if |sBatteryObserver| already exists.  So
please assert !sBatteryObserver here.

>+    sBatteryObserver = new BatteryObserver;

Please use |new BatteryObserver();| --- the idiom |new
BatteryObserver;| has a specific meaning that's not intended here :).
It's a little distracting.

>+static void
>+sDisableBatteryNotifications()

Similarly to above, please call this
|UnregisterBatteryObserverIOThread()|.

>+{
>+  if (sBatteryObserver) {

Similar to the logic above, sBatteryObserver should always be non-null
here.  Please assert that.

This looks better.  I would like to see the next version with the
comments above fixed.

Almost there! :)
Comment 14 Cervantes Yu [:cyu] [:cervantes] 2012-04-10 01:40:54 PDT
Created attachment 613516 [details] [diff] [review]
Uevent poller implementation (v3)

Updated per review comment #12
Comment 15 Cervantes Yu [:cyu] [:cervantes] 2012-04-10 01:41:49 PDT
Created attachment 613517 [details] [diff] [review]
Refactor battery updater using the uevent poller (v3)

Updated per comment #13
Comment 16 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-10 08:20:21 PDT
Comment on attachment 613517 [details] [diff] [review]
Refactor battery updater using the uevent poller (v3)

(In reply to Chris Jones [:cjones] [:warhammer] from comment #13)
> Comment on attachment 613258 [details] [diff] [review]
> Refactor battery updater using the uevent poller (v2)
> 
> >diff --git a/hal/gonk/GonkHal.cpp b/hal/gonk/GonkHal.cpp
> 
> >+static BatteryObserver *sBatteryObserver = NULL;
> 
> Note here that the IO thread "owns" this object: only the IO thread
> may create/destroy it.
> 

Missed this comment.

r=me with that comment added.

\o/
Comment 17 Cervantes Yu [:cyu] [:cervantes] 2012-04-11 01:01:46 PDT
Created attachment 613896 [details] [diff] [review]
Refactor battery updater using the uevent poller (v4)

updated per comment #16
Comment 18 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-11 01:33:15 PDT
Comment on attachment 613896 [details] [diff] [review]
Refactor battery updater using the uevent poller (v4)

(For future reference, if I say "r=me if you do X, Y, Z" in a review comment, it means that you don't need to request review from me again; you have my r+ if you do X, Y, Z.  But always feel free to request review again if you want to :) .)
Comment 20 Ryan VanderMeulen [:RyanVM] 2012-04-12 17:06:09 PDT
Backed out due to b2g bustage. You got bitrotted by bug 728171. Please rebase.
https://hg.mozilla.org/integration/mozilla-inbound/rev/1ae36c75ffb3

Here's a log:
https://tbpl.mozilla.org/php/getParsedLog.php?id=10854889&tree=Mozilla-Inbound
UeventPoller.cpp
/usr/bin/ccache /builds/slave/m-in-b2g/build/gonk-toolchain/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-g++ -o UeventPoller.o -c  -fvisibility=hidden -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES  -DSTATIC_EXPORTABLE_JS_API -DOSTYPE=\"Linux\" -DOSARCH=Linux -DEXCLUDE_SKIA_DEPENDENCIES  -DOS_LINUX=1 -DOS_POSIX=1  -I/builds/slave/m-in-b2g/build/ipc/chromium/src -I/builds/slave/m-in-b2g/build/ipc/glue -I../ipc/ipdl/_ipdlheaders  -I/builds/slave/m-in-b2g/build/hal -I. -I../dist/include -I../dist/include/nsprpub  -I/builds/slave/m-in-b2g/build/obj-b2g/dist/include/nspr -I/builds/slave/m-in-b2g/build/obj-b2g/dist/include/nss      -fPIC -DANDROID -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/include/ -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/kernel/common -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/arch-arm/include -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/kernel/arch-arm -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libm/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/opengl/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/native/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/hardware/libhardware/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/hardware/libhardware_legacy/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/system/core/include -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/services/sensorservice -fno-rtti -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-ctor-dtor-privacy -Wno-overlength-strings -Wno-invalid-offsetof -Wno-variadic-macros -Wno-long-long -mandroid -fno-short-enums -fno-exceptions -DMOZ_ENABLE_JS_DUMP -I/builds/slave/m-in-b2g/build/gonk-toolchain/ndk/sources/cxx-stl/stlport/stlport/ -march=armv7-a -mthumb -mfpu=vfp -mfloat-abi=softfp -fno-exceptions -fno-strict-aliasing -std=gnu++0x -ffunction-sections -fdata-sections -pipe -DNDEBUG -DTRIMMED -g -Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer -funwind-tables   -DANDROID -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/include/ -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/kernel/common -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/arch-arm/include -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libc/kernel/arch-arm -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic/libm/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/opengl/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/native/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/hardware/libhardware/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/hardware/libhardware_legacy/include -I/builds/slave/m-in-b2g/build/gonk-toolchain/system/core/include -isystem /builds/slave/m-in-b2g/build/gonk-toolchain/bionic -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/include  -I/builds/slave/m-in-b2g/build/gonk-toolchain/frameworks/base/services/sensorservice -DMOZILLA_CLIENT -include ../mozilla-config.h -MD -MF .deps/UeventPoller.pp /builds/slave/m-in-b2g/build/hal/gonk/UeventPoller.cpp
../../hal/gonk/UeventPoller.cpp: In member function 'bool mozilla::hal_impl::NetlinkPoller::OpenSocket()':
../../hal/gonk/UeventPoller.cpp:82: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:83: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:88: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:92: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:97: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:101: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:110: error: 'class mozilla::ScopedClose' has no member named 'mFd'
../../hal/gonk/UeventPoller.cpp:113: error: 'class mozilla::ScopedClose' has no member named 'mFd'
make[5]: *** [UeventPoller.o] Error 1
make[5]: *** Waiting for unfinished jobs....
In file included from ../../gonk-toolchain/frameworks/base/include/utils/Log.h:31,
                 from ../../gonk-toolchain/frameworks/base/include/utils/Vector.h:24,
                 from ../../gonk-toolchain/frameworks/base/include/utils/SortedVector.h:24,
                 from ../../gonk-toolchain/frameworks/base/include/utils/KeyedVector.h:24,
                 from ../../gonk-toolchain/frameworks/base/services/sensorservice/SensorDevice.h:23,
                 from ../../hal/gonk/GonkSensor.cpp:13:
../../gonk-toolchain/system/core/include/cutils/log.h:320:1: warning: "LOG_ASSERT" redefined
In file included from ../../ipc/chromium/src/base/string_util_posix.h:13,
                 from ../../ipc/chromium/src/base/string_util.h:106,
                 from ../../ipc/chromium/src/chrome/common/ipc_message_utils.h:13,
                 from ../dist/include/IPC/IPCMessageUtils.h:42,
                 from ../ipc/ipdl/_ipdlheaders/mozilla/hal_sandbox/PHal.h:14,
                 from ../../hal/Hal.h:10,
                 from ../../hal/gonk/GonkSensor.cpp:9:
../../ipc/chromium/src/base/logging.h:101:1: warning: this is the location of the previous definition
../../hal/gonk/GonkSensor.cpp:21:1: warning: "LOG" redefined
../../ipc/chromium/src/base/logging.h:87:1: warning: this is the location of the previous definition
../../hal/gonk/GonkHal.cpp:38:1: warning: "LOG" redefined
In file included from ../../ipc/chromium/src/base/observer_list.h:13,
                 from ../../ipc/chromium/src/base/message_loop.h:16,
                 from ../../hal/gonk/GonkHal.cpp:7:
../../ipc/chromium/src/base/logging.h:87:1: warning: this is the location of the previous definition
../../hal/gonk/GonkHal.cpp: In function 'void mozilla::hal_impl::GetCurrentBatteryInformation(mozilla::hal::BatteryInformation*)':
../../hal/gonk/GonkHal.cpp:300: warning: format '%s' expects type 'char*', but argument 3 has type 'char (*)[16]'
make[5]: Leaving directory `/builds/slave/m-in-b2g/build/obj-b2g/hal'
make[4]: *** [libs_tier_platform] Error 2
make[4]: Leaving directory `/builds/slave/m-in-b2g/build/obj-b2g'
make[3]: *** [tier_platform] Error 2
make[3]: Leaving directory `/builds/slave/m-in-b2g/build/obj-b2g'
make[2]: *** [default] Error 2
make[2]: Leaving directory `/builds/slave/m-in-b2g/build/obj-b2g'
make[1]: *** [realbuild] Error 2
make[1]: Leaving directory `/builds/slave/m-in-b2g/build'
make: *** [build] Error 2
Comment 21 Cervantes Yu [:cyu] [:cervantes] 2012-04-12 23:17:33 PDT
Created attachment 614690 [details] [diff] [review]
Uevent poller implementation (v4)

Rebase the patch on bug 728171.

Test result: https://tbpl.mozilla.org/?tree=Try&rev=ab39af663ec5
The failures should not be relevant to the patch
Comment 23 Cervantes Yu [:cyu] [:cervantes] 2012-04-14 07:51:58 PDT
Hi Ryan,

This is gonk hal layer implementation so I had only manual tests and regression tests on try server. Do you think I need to have more tests? Thanks.
Comment 24 Ryan VanderMeulen [:RyanVM] 2012-04-14 08:00:54 PDT
Automatic tests are always a good thing. If you feel that the existing tests are sufficient, that's fine. I'm just asking the question :)
Comment 26 Chris Jones [:cjones] inactive; ni?/f?/r? if you need me 2012-04-16 14:33:30 PDT
We'll test this code through higher-level interfaces, the DOM APIs and features that rely on this.  The code here isn't a public interface so the value of unit testing it is close to nil.  (It's also extremely hard to unit test.)
Comment 27 Ryan VanderMeulen [:RyanVM] 2012-04-16 14:34:53 PDT
Good enough for me. Thanks.

Note You need to log in before you can comment on or make changes to this bug.