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

Unified Diff: content/test/layout_tests/runner/MockWebMIDIAccessor.h

Issue 110533009: Import TestRunner library into chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years 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: content/test/layout_tests/runner/MockWebMIDIAccessor.h
diff --git a/third_party/tcmalloc/chromium/src/base/spinlock_internal.h b/content/test/layout_tests/runner/MockWebMIDIAccessor.h
similarity index 53%
copy from third_party/tcmalloc/chromium/src/base/spinlock_internal.h
copy to content/test/layout_tests/runner/MockWebMIDIAccessor.h
index 44942609f40a87492a7aeed0068a5e27bf9cd157..0d2481339c509ae72950b70b668b44b44c808083 100644
--- a/third_party/tcmalloc/chromium/src/base/spinlock_internal.h
+++ b/content/test/layout_tests/runner/MockWebMIDIAccessor.h
@@ -1,5 +1,9 @@
-/* Copyright (c) 2010, Google Inc.
- * All rights reserved.
+// Copyright 2013 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.
+
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -26,39 +30,46 @@
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * ---
- * This file is an internal part spinlock.cc and once.cc
- * It may not be used directly by code outside of //base.
*/
-#ifndef BASE_SPINLOCK_INTERNAL_H_
-#define BASE_SPINLOCK_INTERNAL_H_
+#ifndef MockWebMIDIAccessor_h
+#define MockWebMIDIAccessor_h
+
+#include "content/public/test/layout_tests/WebTask.h"
+#include "content/test/layout_tests/runner/TestCommon.h"
+#include "third_party/WebKit/public/platform/WebMIDIAccessor.h"
+#include "third_party/WebKit/public/platform/WebNonCopyable.h"
+
+namespace blink {
+class WebMIDIAccessorClient;
+}
+
+namespace WebTestRunner {
+
+class TestInterfaces;
+
+class MockWebMIDIAccessor : public blink::WebMIDIAccessor, public blink::WebNonCopyable {
+public:
+ explicit MockWebMIDIAccessor(blink::WebMIDIAccessorClient*, TestInterfaces*);
+ virtual ~MockWebMIDIAccessor();
-#include <config.h>
-#include "base/basictypes.h"
-#include "base/atomicops.h"
+ // blink::WebMIDIAccessor implementation.
+ virtual void startSession() OVERRIDE;
+ virtual void sendMIDIData(
+ unsigned portIndex,
+ const unsigned char* data,
+ size_t length,
+ double timestamp) OVERRIDE { }
-namespace base {
-namespace internal {
+ // WebTask related methods
+ WebTaskList* taskList() { return &m_taskList; }
-// SpinLockWait() waits until it can perform one of several transitions from
-// "from" to "to". It returns when it performs a transition where done==true.
-struct SpinLockWaitTransition {
- int32 from;
- int32 to;
- bool done;
+private:
+ blink::WebMIDIAccessorClient* m_client;
+ WebTaskList m_taskList;
+ TestInterfaces* m_interfaces;
};
-// Wait until *w can transition from trans[i].from to trans[i].to for some i
-// satisfying 0<=i<n && trans[i].done, atomically make the transition,
-// then return the old value of *w. Make any other atomic tranistions
-// where !trans[i].done, but continue waiting.
-int32 SpinLockWait(volatile Atomic32 *w, int n,
- const SpinLockWaitTransition trans[]);
-void SpinLockWake(volatile Atomic32 *w, bool all);
-void SpinLockDelay(volatile Atomic32 *w, int32 value, int loop);
+} // namespace WebTestRunner
-} // namespace internal
-} // namespace base
-#endif
+#endif // MockWebMIDIAccessor_h

Powered by Google App Engine
This is Rietveld 408576698