Skip to content

Commit

Permalink
Committing clang-format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
openkraken-bot committed Dec 21, 2021
1 parent b99f836 commit 5d6a3e7
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 48 deletions.
1 change: 0 additions & 1 deletion bridge/bindings/qjs/dom/event_target.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ struct NativeEventTarget {
#else
CallNativeMethods callNativeMethods{nullptr};
#endif

};

class EventTargetInstance : public Instance {
Expand Down
2 changes: 1 addition & 1 deletion bridge/bindings/qjs/js_context_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
*/

#include "gtest/gtest.h"
#include "page.h"
#include "kraken_test_env.h"
#include "page.h"

TEST(Context, isValid) {
auto bridge = TEST_init();
Expand Down
2 changes: 1 addition & 1 deletion bridge/kraken_bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void disposePage(int32_t contextId) {
assert(contextId < maxPoolSize);
if (pageContextPool[contextId] == nullptr)
return;
// UnitTest will free page after test suit complete.
// UnitTest will free page after test suit complete.
#ifndef UNIT_TEST
auto* page = static_cast<kraken::KrakenPage*>(pageContextPool[contextId]);
delete page;
Expand Down
71 changes: 27 additions & 44 deletions bridge/test/kraken_test_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
*/

#include "kraken_test_env.h"
#include "dart_methods.h"
#include "include/kraken_bridge.h"
#include <sys/time.h>
#include <vector>
#include "page.h"
#include "bindings/qjs/dom/event_target.h"
#include "dart_methods.h"
#include "include/kraken_bridge.h"
#include "kraken_bridge_test.h"
#include "page.h"

#if defined(__linux__) || defined(__APPLE__)
static int64_t get_time_ms(void) {
Expand Down Expand Up @@ -61,13 +61,9 @@ NativeString* TEST_invokeModule(void* callbackContext, int32_t contextId, Native
return nullptr;
};

void TEST_requestBatchUpdate(int32_t contextId) {
};

void TEST_reloadApp(int32_t contextId) {

}
void TEST_requestBatchUpdate(int32_t contextId){};

void TEST_reloadApp(int32_t contextId) {}

int32_t timerId = 0;

Expand Down Expand Up @@ -150,30 +146,20 @@ NativeString* TEST_platformBrightness(int32_t contextId) {
return nullptr;
}

void TEST_toBlob(void* callbackContext, int32_t contextId, AsyncBlobCallback blobCallback, int32_t elementId, double devicePixelRatio) {
void TEST_toBlob(void* callbackContext, int32_t contextId, AsyncBlobCallback blobCallback, int32_t elementId, double devicePixelRatio) {}

}
void TEST_flushUICommand() {}

void TEST_flushUICommand() {
void TEST_initWindow(int32_t contextId, void* nativePtr) {}

}

void TEST_initWindow(int32_t contextId, void* nativePtr) {

}

void TEST_initDocument(int32_t contextId, void* nativePtr) {

}
void TEST_initDocument(int32_t contextId, void* nativePtr) {}

#if ENABLE_PROFILE
struct NativePerformanceEntryList {
uint64_t* entries;
int32_t length;
};
NativePerformanceEntryList* TEST_getPerformanceEntries(int32_t) {

}
NativePerformanceEntryList* TEST_getPerformanceEntries(int32_t) {}
#endif

std::unique_ptr<kraken::KrakenPage> TEST_init(OnJSError onJsError) {
Expand All @@ -183,22 +169,22 @@ std::unique_ptr<kraken::KrakenPage> TEST_init(OnJSError onJsError) {
JSThreadState* th = new JSThreadState();
JS_SetRuntimeOpaque(context->runtime(), th);

std::vector<uint64_t> mockMethods {
reinterpret_cast<uint64_t>(TEST_invokeModule),
reinterpret_cast<uint64_t>(TEST_requestBatchUpdate),
reinterpret_cast<uint64_t>(TEST_reloadApp),
reinterpret_cast<uint64_t>(TEST_setTimeout),
reinterpret_cast<uint64_t>(TEST_setInterval),
reinterpret_cast<uint64_t>(TEST_clearTimeout),
reinterpret_cast<uint64_t>(TEST_requestAnimationFrame),
reinterpret_cast<uint64_t>(TEST_cancelAnimationFrame),
reinterpret_cast<uint64_t>(TEST_getScreen),
reinterpret_cast<uint64_t>(TEST_devicePixelRatio),
reinterpret_cast<uint64_t>(TEST_platformBrightness),
reinterpret_cast<uint64_t>(TEST_toBlob),
reinterpret_cast<uint64_t>(TEST_flushUICommand),
reinterpret_cast<uint64_t>(TEST_initWindow),
reinterpret_cast<uint64_t>(TEST_initDocument),
std::vector<uint64_t> mockMethods{
reinterpret_cast<uint64_t>(TEST_invokeModule),
reinterpret_cast<uint64_t>(TEST_requestBatchUpdate),
reinterpret_cast<uint64_t>(TEST_reloadApp),
reinterpret_cast<uint64_t>(TEST_setTimeout),
reinterpret_cast<uint64_t>(TEST_setInterval),
reinterpret_cast<uint64_t>(TEST_clearTimeout),
reinterpret_cast<uint64_t>(TEST_requestAnimationFrame),
reinterpret_cast<uint64_t>(TEST_cancelAnimationFrame),
reinterpret_cast<uint64_t>(TEST_getScreen),
reinterpret_cast<uint64_t>(TEST_devicePixelRatio),
reinterpret_cast<uint64_t>(TEST_platformBrightness),
reinterpret_cast<uint64_t>(TEST_toBlob),
reinterpret_cast<uint64_t>(TEST_flushUICommand),
reinterpret_cast<uint64_t>(TEST_initWindow),
reinterpret_cast<uint64_t>(TEST_initDocument),
};

#if ENABLE_PROFILE
Expand All @@ -222,7 +208,6 @@ std::unique_ptr<kraken::KrakenPage> TEST_allocateNewPage() {
return std::unique_ptr<kraken::KrakenPage>(static_cast<kraken::KrakenPage*>(getPage(newContextId)));
}


static bool jsPool(ExecutionContext* context) {
JSRuntime* rt = context->runtime();
JSThreadState* ts = static_cast<JSThreadState*>(JS_GetRuntimeOpaque(rt));
Expand Down Expand Up @@ -288,6 +273,4 @@ void TEST_dispatchEvent(EventTargetInstance* eventTarget, const std::string type
NativeEventTarget::dispatchEventImpl(nativeEventTarget, nativeEventType.get(), &rawEvent, false);
}

void TEST_callNativeMethod(void* nativePtr, void* returnValue, void* method, int32_t argc, void* argv) {

}
void TEST_callNativeMethod(void* nativePtr, void* returnValue, void* method, int32_t argc, void* argv) {}
2 changes: 1 addition & 1 deletion bridge/test/kraken_test_env.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#ifndef KRAKENBRIDGE_TEST_KRAKEN_TEST_ENV_H_
#define KRAKENBRIDGE_TEST_KRAKEN_TEST_ENV_H_

#include <memory>
#include "bindings/qjs/bom/timer.h"
#include "bindings/qjs/dom/event_target.h"
#include "bindings/qjs/dom/frame_request_callback_collection.h"
#include "include/dart_methods.h"
#include "page.h"
#include <memory>

using namespace kraken::binding::qjs;

Expand Down

0 comments on commit 5d6a3e7

Please sign in to comment.